-
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
test: add a simple abort check in windows #12914
Conversation
This looks great, if you could add a two line summary of what the test tests that would be ideal (see the writing tests guide). |
@gibfahn Done. Added summary. Thanks |
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 with a couple nits.
if (process.argv[2] === 'child') { | ||
process.abort(); | ||
} else { | ||
const child = spawn(process.argv[0], [process.argv[1], 'child']); |
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.
Nit, but could you use process.execPath
and __filename
instead of the argv values? I think it's a little more readable.
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.
Done.
const assert = require('assert'); | ||
|
||
// This test makes sure that an aborted node process | ||
// exits with code 3 in windows. |
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.
in windows -> on Windows
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.
Done. Thanks.
// This test makes sure that an aborted node process | ||
// exits with code 3 in windows. | ||
// Spawn a child, force an abort, and then check the | ||
// exit code in the parent. Assert on code and signal |
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.
You can probably drop the last sentence.
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.
Done.
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 with @cjihrig's comments addressed.
raise(SIGABRT) or CRT abort causes exit code 3 and null signal in windows. Looks like this simple assertion is not present in windows. Make this assertion.
Landed in 642bd4d |
raise(SIGABRT) or CRT abort causes exit code 3 and null signal in windows. Looks like this simple assertion is not present in windows. Make this assertion. PR-URL: #12914 Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
post land CI:https://ci.nodejs.org/job/node-test-commit/9853/ |
raise(SIGABRT) or CRT abort causes exit code 3 and null signal in windows. Looks like this simple assertion is not present in windows. Make this assertion. PR-URL: nodejs#12914 Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
does this make sense for v6.x? |
Yes. (just checked it passes as is). |
raise(SIGABRT) or CRT abort causes exit code 3 and null signal in windows. Looks like this simple assertion is not present in windows. Make this assertion. PR-URL: #12914 Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test
Working with @gireeshpunathil, I came up with this PR following @refack's suggestion
in #12856 . Though associated with that, this test is logically independent of that PR,
and does not need to co-exist with that one, and hence a separate one.
Make a simple assertion that Windows aborts with exit code 3.