From e4136c1ecec04c646228bd3fae4dac17df1dc348 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 19 Jun 2019 11:54:58 -0700 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/28305 Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- test/async-hooks/test-graph.signal.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/async-hooks/test-graph.signal.js b/test/async-hooks/test-graph.signal.js index 67bf1cf6d8d3ab..b0a45ddf67765a 100644 --- a/test/async-hooks/test-graph.signal.js +++ b/test/async-hooks/test-graph.signal.js @@ -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' },