-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add two child-process stdio flush tests #7257
Add two child-process stdio flush tests #7257
Conversation
While commit 12274a5 fixed data loss when a readable event handler is attached, the problem still exists when the stdio stream has a piped consumer that doesn't read fast enough. Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
In order for the testcase to fail, the calls to read() must be done after 'exit' is emitted and after flushStdio has been called. With this change, the testcase will catch any regressions on this issue. Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
@petrosagg Thanks, this is appreciated a lot! It would be great if we could replace spawning The subject line of the first commit should also probably start with |
@mscdex Okay, so, apparently the order of some child-process-related I/O events changed in libuv/libuv#611, making the test work even without your fix from #5036… would that make sense to you? |
@addaleax if that's the case, then I'm fine with that change |
function spawnWithPipe() { | ||
const buffer = []; | ||
const through = new stream.PassThrough(); | ||
const p = cp.spawn('seq', [ '36000' ]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the spaces inside the square braces.
Initial CI (rebased against master to include #7160): https://ci.nodejs.org/job/node-test-commit/3741/ |
CI is red with timeouts in |
ping @petrosagg The test timeouts seem to stem from I’m not sure how that’s best addressed. Killing the child process after a short timeout seems a bit crude, but it’s the most reliable thing that comes to my mind right now. |
@petrosagg Still interested in pursuing this? I’d definitely like to get these tests in in some way, and if you’re not feeling like it, I’d like to offer to take over. |
c133999
to
83c7a88
Compare
ping @addaleax ... still interested in pursuing this? |
yeah let’s close this out, the underlying issues in the streams implementation have been fixed & have tests |
Checklist
make -j4 test
(UNIX) orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
child-process
Description of change
Fixed a previous testcase that wasn't actually triggering the condition it tried to test. Added a new test that needs #7160 to be merged for it to pass.