summaryrefslogtreecommitdiff
path: root/test/async-hooks
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2019-06-19 11:54:58 -0700
committerRich Trott <rtrott@gmail.com>2019-06-21 20:57:32 -0600
commite4136c1ecec04c646228bd3fae4dac17df1dc348 (patch)
tree633f5648c8b41c6aac44130902e1ced7d906eff5 /test/async-hooks
parent5705d7bf6089bb8f8a8887658f7c60de6779491c (diff)
downloadandroid-node-v8-e4136c1ecec04c646228bd3fae4dac17df1dc348.tar.gz
android-node-v8-e4136c1ecec04c646228bd3fae4dac17df1dc348.tar.bz2
android-node-v8-e4136c1ecec04c646228bd3fae4dac17df1dc348.zip
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 <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/async-hooks')
-rw-r--r--test/async-hooks/test-graph.signal.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/async-hooks/test-graph.signal.js b/test/async-hooks/test-graph.signal.js
index 67bf1cf6d8..b0a45ddf67 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' },