Skip to content

Commit

Permalink
test: permit test-graph.signal to work without test runner
Browse files Browse the repository at this point in the history
test/async-hooks/test-graph.signal.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: #28305
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and targos committed Jul 2, 2019
1 parent 53297e6 commit 8346596
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/async-hooks/test-graph.signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ function onexit() {
{ type: 'PIPEWRAP', id: 'pipe:4', triggerAsyncId: 'signal:1' },
{ type: 'PIPEWRAP', id: 'pipe:5', triggerAsyncId: 'signal:1' },
{ type: 'PIPEWRAP', id: 'pipe:6', triggerAsyncId: 'signal:1' },
{ type: 'SIGNALWRAP', id: 'signal:2', triggerAsyncId: 'signal:1' },
{ type: 'SIGNALWRAP', id: 'signal:2',
// TEST_THREAD_ID is set by tools/test.py. Adjust test results depending
// on whether the test was invoked via test.py or from the shell
// directly.
triggerAsyncId: process.env.TEST_THREAD_ID ? 'signal:1' : 'pipe:2' },
{ type: 'PROCESSWRAP', id: 'process:3', triggerAsyncId: 'signal:1' },
{ type: 'PIPEWRAP', id: 'pipe:7', triggerAsyncId: 'signal:1' },
{ type: 'PIPEWRAP', id: 'pipe:8', triggerAsyncId: 'signal:1' },
Expand Down

0 comments on commit 8346596

Please sign in to comment.