-
Notifications
You must be signed in to change notification settings - Fork 30k
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
test: fix test-child-process-stdout-flush-exit #1868
test: fix test-child-process-stdout-flush-exit #1868
Conversation
Make sure all the stdout data is available before performing the assertions.
assert(gotBye); | ||
child.on('close', function() { | ||
assert.equal(stdout.slice(0, 6), 'hello\n'); | ||
assert.equal(stdout.slice(stdout.length - 8), 'goodbye\n'); | ||
}); |
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 wrap the callback in a common.mustCall(...)
while you're here? LGTM otherwise.
@bnoordhuis done. Thanks |
Cheers. Let's see what the CI thinks: https://jenkins-iojs.nodesource.com/view/iojs/job/iojs+any-pr+multi/751/ |
Probably related to #944 |
}); | ||
child.on('close', common.mustCall(function() { | ||
assert.equal(stdout.slice(0, 6), 'hello\n'); | ||
assert.equal(stdout.slice(stdout.length - 8), 'goodbye\n'); |
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.
assert.strictEqual
would be better, no?
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.
Doesn't really matter for primitives. I'll land it, CI is happy.
Landed in 311c3e4, thanks. |
(LGTM) |
Make sure all the stdout data is available before performing the assertions. Fixes: #944 PR-URL: #1868 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Updated in b926718. |
Make sure all the stdout data is available before performing the assertions. Fixes: nodejs/node#944 PR-URL: nodejs/node#1868 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Make sure all the stdout data is available before
performing the assertions.
Before this change, I was getting this error from time to time: