node-sdk icon indicating copy to clipboard operation
node-sdk copied to clipboard

Fix #31: "should receive container stdout on attach" by ensuring stream data is fully written

Open MattHandzel opened this issue 2 months ago • 2 comments

- 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) image

MattHandzel avatar Oct 12 '25 21:10 MattHandzel

Thanks a lot for your contribution. Please run npm run format to fix CI

ndeloof avatar Oct 14 '25 05:10 ndeloof

I guess this issue is fixed by https://github.com/docker/node-sdk/pull/47/files#diff-406198e18bb578d844d48953e9187cb6a344bf35063fa9d29e7efbec88c39c25R452-R455 WDYT ?

ndeloof avatar Oct 14 '25 14:10 ndeloof