Fix #31: "should receive container stdout on attach" by ensuring stream data is fully written
- What I did Fixes #31 "investigate flaky test"
- How I did it Explicitly waiting for stdout stream to finish by calling stream.end() and listening for the 'finish' event. This ensures all piped data has been written to the stdoutData array before any test assertions, which fixes flaky behavior.
- How to verify it
Run npm test -- --run "test/container.test.ts" -t "should receive container stdout on attach" until you are convinced it is no longer flaky. (I ran it 200 times)
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)
Thanks a lot for your contribution.
Please run npm run format to fix CI
I guess this issue is fixed by https://github.com/docker/node-sdk/pull/47/files#diff-406198e18bb578d844d48953e9187cb6a344bf35063fa9d29e7efbec88c39c25R452-R455 WDYT ?