Skip to content

Commit 8346596

Browse files
Trotttargos
authored andcommitted
test: permit test-graph.signal to work without test runner
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]>
1 parent 53297e6 commit 8346596

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/async-hooks/test-graph.signal.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ function onexit() {
5353
{ type: 'PIPEWRAP', id: 'pipe:4', triggerAsyncId: 'signal:1' },
5454
{ type: 'PIPEWRAP', id: 'pipe:5', triggerAsyncId: 'signal:1' },
5555
{ type: 'PIPEWRAP', id: 'pipe:6', triggerAsyncId: 'signal:1' },
56-
{ type: 'SIGNALWRAP', id: 'signal:2', triggerAsyncId: 'signal:1' },
56+
{ type: 'SIGNALWRAP', id: 'signal:2',
57+
// TEST_THREAD_ID is set by tools/test.py. Adjust test results depending
58+
// on whether the test was invoked via test.py or from the shell
59+
// directly.
60+
triggerAsyncId: process.env.TEST_THREAD_ID ? 'signal:1' : 'pipe:2' },
5761
{ type: 'PROCESSWRAP', id: 'process:3', triggerAsyncId: 'signal:1' },
5862
{ type: 'PIPEWRAP', id: 'pipe:7', triggerAsyncId: 'signal:1' },
5963
{ type: 'PIPEWRAP', id: 'pipe:8', triggerAsyncId: 'signal:1' },

0 commit comments

Comments
 (0)