Skip to content
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

Closed
wants to merge 1 commit into from
Closed

test: add a simple abort check in windows #12914

wants to merge 1 commit into from

Conversation

sreepurnajasti
Copy link
Contributor

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected 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.

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label May 9, 2017
@mscdex mscdex added the windows Issues and PRs related to the Windows platform. label May 9, 2017
@mscdex
Copy link
Contributor

mscdex commented May 9, 2017

@gibfahn
Copy link
Member

gibfahn commented May 9, 2017

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

@sreepurnajasti
Copy link
Contributor Author

@gibfahn Done. Added summary. Thanks

Copy link
Contributor

@cjihrig cjihrig left a 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']);
Copy link
Contributor

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.

Copy link
Contributor Author

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in windows -> on Windows

Copy link
Contributor Author

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
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member

@jasnell jasnell left a 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.
@refack
Copy link
Contributor

refack commented May 12, 2017

Landed in 642bd4d

@refack refack closed this May 12, 2017
refack pushed a commit that referenced this pull request May 12, 2017
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]>
@refack
Copy link
Contributor

refack commented May 12, 2017

anchnk pushed a commit to anchnk/node that referenced this pull request May 19, 2017
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]>
@jasnell jasnell mentioned this pull request May 28, 2017
@gibfahn gibfahn mentioned this pull request Jun 15, 2017
3 tasks
@MylesBorins
Copy link
Contributor

does this make sense for v6.x?

@refack
Copy link
Contributor

refack commented Jun 22, 2017

does this make sense for v6.x?

Yes. (just checked it passes as is).

MylesBorins pushed a commit that referenced this pull request Jul 17, 2017
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]>
@MylesBorins MylesBorins mentioned this pull request Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants