test: permit test-signalwrap to work without test runner#28306
test: permit test-signalwrap to work without test runner#28306Trott merged 0 commit intonodejs:masterfrom
Conversation
test/async-hooks/test-signalwrap.js
Outdated
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@bnoordhuis Would the test be more robust by checking process.stdout.isTTY and process.stderr.isTTY rather than process.env.TEST_THREAD_ID?
There was a problem hiding this comment.
@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.
37f498c to
07c0428
Compare
|
OK, all fixed up! |
|
Landed in 2d1b512 |
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>
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>
test/async-hooks/test-signalwrap.js passes with the test.py test runner
but fails if run directly with the
nodeexecutable. Modify the test soit passes in both cases.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes