-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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: fail when child died in fork-net #11684
Conversation
Deleted @AndreasMadsen (pinging according to |
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.
LGTM. This will need another CI run though.
@@ -3,6 +3,7 @@ require('../common'); | |||
const assert = require('assert'); | |||
const fork = require('child_process').fork; | |||
const net = require('net'); | |||
const common = require('../common'); |
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.
common
is already required a few lines up. It just needs to be assigned to a variable.
@@ -60,9 +61,11 @@ if (process.argv[2] === 'child') { | |||
|
|||
const child = fork(process.argv[1], ['child']); | |||
|
|||
child.on('exit', function() { | |||
child.on('exit', common.mustCall(function(code, signal) { | |||
console.log('CHILD: died'); |
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 this console.log()
since it's now included in the assertion message.
@joyeecheung |
Previously when the child dies with errors in this test, the parent will just hang and timeout, the errors in the child would be swallowed. This makes it fail so at least there is more information about why this test fails. Also removes the unnecessary child.kill() call.
caac394
to
8eb9e51
Compare
@AndreasMadsen I asked just in case...anyway thanks for the reply :) Addressed @cjihrig 's comments. CI: https://ci.nodejs.org/job/node-test-pull-request/6838/ |
Previously when the child dies with errors in this test, the parent will just hang and timeout, the errors in the child would be swallowed. This makes it fail so at least there is more information about why this test fails. Also removes the unnecessary child.kill() call. PR-URL: #11684 Ref: #11667 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in c9bc3e5 |
Previously when the child dies with errors in this test, the parent will just hang and timeout, the errors in the child would be swallowed. This makes it fail so at least there is more information about why this test fails. Also removes the unnecessary child.kill() call. PR-URL: nodejs#11684 Ref: nodejs#11667 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Previously when the child dies with errors in this test, the parent will just hang and timeout, the errors in the child would be swallowed. This makes it fail so at least there is more information about why this test fails. Also removes the unnecessary child.kill() call. PR-URL: nodejs#11684 Ref: nodejs#11667 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Previously when the child dies with errors in this test, the parent will just hang and timeout, the errors in the child would be swallowed. This makes it fail so at least there is more information about why this test fails. Also removes the unnecessary child.kill() call. PR-URL: #11684 Ref: #11667 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Previously when the child dies with errors in this test, the parent will just hang and timeout, the errors in the child would be swallowed. This makes it fail so at least there is more information about why this test fails. Also removes the unnecessary child.kill() call. PR-URL: #11684 Ref: #11667 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Previously when the child dies with errors in this test, the parent will just hang and timeout, the errors in the child would be swallowed. This makes it fail so at least there is more information about why this test fails. Also removes the unnecessary child.kill() call. PR-URL: nodejs/node#11684 Ref: nodejs/node#11667 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Previously when the child dies with errors in this test, the parent will just hang and timeout, the errors in the child would be swallowed. This PR makes it fail so at least there is more information about why this test fails.
On a side note, looks like this test is the only test that is touching the
options instanceof TCP
section innet.Server.prototyp.listen
, and it is touching an undocumented API (callingnet.Server.prototyp.listen
on the TCP handle directly instead of putting it in an object'shandle
or_handle
) indirectly through child_process. This probably means the documented API for handles (like{handle: new TCP()}
) doesn't get any direct test coverage.Refs: #11667
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test, child_process, net