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 <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Trott committed Jun 22, 2019
1 parent 5705d7b commit e4136c1
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 e4136c1

Please sign in to comment.