Skip to content

test: permit test-signalwrap to work without test runner - #28306

Merged
Trott merged 0 commit into
nodejs:masterfrom
Trott:denver-2
Sep 8, 2019
Merged

test: permit test-signalwrap to work without test runner#28306
Trott merged 0 commit into
nodejs:masterfrom
Trott:denver-2

Conversation

@Trott

@Trott Trott commented Jun 19, 2019

Copy link
Copy Markdown
Member

test/async-hooks/test-signalwrap.js passes with the test.py test runner
but fails if run directly with the node executable. Modify the test so
it passes in both cases.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added async_hooks Issues and PRs related to the async hooks subsystem. test Issues and PRs related to Node.js core tests and test infrastructure. labels Jun 19, 2019
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Comment thread test/async-hooks/test-signalwrap.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can I suggest updating the comment to explain that the third signal event listener is the SIGWINCH handler that node installs when it thinks process.stdout is a tty?

It's still kind of fragile because there might be a second SIGWINCH handler for process.stderr, i.e., a total of 4.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@bnoordhuis Would the test be more robust by checking process.stdout.isTTY and process.stderr.isTTY rather than process.env.TEST_THREAD_ID?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Trott I think that’s better, yes. There is only one async hook per active signal (which should probably be considered a bug), so currently the number is 2 + (process.stdout.isTTY || process.stderr.isTTY), I think.

@Trott Trott added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Jun 20, 2019

@addaleax addaleax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM with Ben’s suggestion

@Trott Trott removed the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Jun 25, 2019
@BridgeAR BridgeAR added the wip Issues and PRs that are still a work in progress. label Jul 4, 2019
@Trott
Trott force-pushed the denver-2 branch 2 times, most recently from 37f498c to 07c0428 Compare September 8, 2019 03:53
@Trott Trott removed the wip Issues and PRs that are still a work in progress. label Sep 8, 2019
@Trott

Trott commented Sep 8, 2019

Copy link
Copy Markdown
Member Author

OK, all fixed up!

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@Trott Trott added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Sep 8, 2019
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@Trott

Trott commented Sep 8, 2019

Copy link
Copy Markdown
Member Author

Landed in 2d1b512

@Trott Trott closed this Sep 8, 2019
@Trott
Trott merged commit 2d1b512 into nodejs:master Sep 8, 2019
targos pushed a commit that referenced this pull request Sep 20, 2019
test/async-hooks/test-signalwrap.js passes with the test.py test runner
but fails if run directly with the `node` executable. Modify the test so
it passes in both cases.

PR-URL: #28306
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@BridgeAR BridgeAR mentioned this pull request Sep 24, 2019
BridgeAR pushed a commit that referenced this pull request Sep 25, 2019
test/async-hooks/test-signalwrap.js passes with the test.py test runner
but fails if run directly with the `node` executable. Modify the test so
it passes in both cases.

PR-URL: #28306
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@Trott
Trott deleted the denver-2 branch January 13, 2022 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

async_hooks Issues and PRs related to the async hooks subsystem. author ready PRs with CI started, the required approvals, and no outstanding review comments. test Issues and PRs related to Node.js core tests and test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants