From ef8c32aad78978f5482a736a5bd7594e9e62ca68 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 5 Apr 2020 22:27:46 +0200 Subject: [PATCH] test: make sure that inspector tests finish --- test/parallel/test-inspector-bindings.js | 2 +- test/parallel/test-inspector-esm.js | 2 +- test/parallel/test-inspector-multisession-js.js | 4 ++-- test/parallel/test-inspector-multisession-ws.js | 2 +- test/parallel/test-inspector-reported-host.js | 2 +- test/parallel/test-inspector-tracing-domain.js | 2 +- test/parallel/test-inspector-wait-for-connection.js | 2 +- test/parallel/test-inspector-waiting-for-disconnect.js | 2 +- .../test-inspector-async-hook-setup-at-inspect-brk.js | 2 +- test/sequential/test-inspector-async-hook-setup-at-signal.js | 2 +- .../test-inspector-async-stack-traces-promise-then.js | 2 +- .../test-inspector-async-stack-traces-set-interval.js | 2 +- test/sequential/test-inspector-break-e.js | 2 +- test/sequential/test-inspector-break-when-eval.js | 2 +- test/sequential/test-inspector-console.js | 2 +- test/sequential/test-inspector-contexts.js | 5 ++++- test/sequential/test-inspector-debug-brk-flag.js | 4 ++-- test/sequential/test-inspector-debug-end.js | 2 +- test/sequential/test-inspector-exception.js | 2 +- test/sequential/test-inspector-ip-detection.js | 2 +- test/sequential/test-inspector-not-blocked-on-idle.js | 2 +- test/sequential/test-inspector-overwrite-config.js | 2 +- test/sequential/test-inspector-resource-name-to-url.js | 2 +- .../test-inspector-runtime-evaluate-with-timeout.js | 2 +- test/sequential/test-inspector-scriptparsed-context.js | 2 +- test/sequential/test-inspector-stop-profile-after-done.js | 2 +- test/sequential/test-inspector-stress-http.js | 2 +- test/sequential/test-inspector.js | 2 +- 28 files changed, 33 insertions(+), 30 deletions(-) diff --git a/test/parallel/test-inspector-bindings.js b/test/parallel/test-inspector-bindings.js index c632bb8840fa..3e88c858f8de 100644 --- a/test/parallel/test-inspector-bindings.js +++ b/test/parallel/test-inspector-bindings.js @@ -127,4 +127,4 @@ async function doTests() { await testNoCrashConsoleLogBeforeThrow(); } -doTests(); +doTests().then(common.mustCall()); diff --git a/test/parallel/test-inspector-esm.js b/test/parallel/test-inspector-esm.js index f0848d29423d..707fa7bb56f9 100644 --- a/test/parallel/test-inspector-esm.js +++ b/test/parallel/test-inspector-esm.js @@ -109,4 +109,4 @@ async function runTest() { assert.strictEqual((await child.expectShutdown()).exitCode, 55); } -runTest(); +runTest().then(common.mustCall()); diff --git a/test/parallel/test-inspector-multisession-js.js b/test/parallel/test-inspector-multisession-js.js index 92879d3ff3a7..31aa0c5f5698 100644 --- a/test/parallel/test-inspector-multisession-js.js +++ b/test/parallel/test-inspector-multisession-js.js @@ -57,7 +57,7 @@ async function test() { } const interval = setInterval(() => {}, 1000); -test().then(() => { +test().then(common.mustCall(() => { clearInterval(interval); console.log('Done!'); -}); +})); diff --git a/test/parallel/test-inspector-multisession-ws.js b/test/parallel/test-inspector-multisession-ws.js index c5ebfd6ef81e..7981eef0d301 100644 --- a/test/parallel/test-inspector-multisession-ws.js +++ b/test/parallel/test-inspector-multisession-ws.js @@ -74,4 +74,4 @@ async function runTest() { return child.expectShutdown(); } -runTest(); +runTest().then(common.mustCall()); diff --git a/test/parallel/test-inspector-reported-host.js b/test/parallel/test-inspector-reported-host.js index b3bc7368032c..676e5387c810 100644 --- a/test/parallel/test-inspector-reported-host.js +++ b/test/parallel/test-inspector-reported-host.js @@ -16,4 +16,4 @@ async function test() { child.kill(); } -test(); +test().then(common.mustCall()); diff --git a/test/parallel/test-inspector-tracing-domain.js b/test/parallel/test-inspector-tracing-domain.js index 9d3d33d94d5b..152df1491553 100644 --- a/test/parallel/test-inspector-tracing-domain.js +++ b/test/parallel/test-inspector-tracing-domain.js @@ -66,4 +66,4 @@ async function test() { console.log('Success'); } -test(); +test().then(common.mustCall()); diff --git a/test/parallel/test-inspector-wait-for-connection.js b/test/parallel/test-inspector-wait-for-connection.js index 44bb6dd5e1c3..0f562faede1e 100644 --- a/test/parallel/test-inspector-wait-for-connection.js +++ b/test/parallel/test-inspector-wait-for-connection.js @@ -58,4 +58,4 @@ async function runTests() { assert.throws(() => require('inspector').waitForDebugger(), re); } -runTests(); +runTests().then(common.mustCall()); diff --git a/test/parallel/test-inspector-waiting-for-disconnect.js b/test/parallel/test-inspector-waiting-for-disconnect.js index 187875abc1b6..e9d39978d7aa 100644 --- a/test/parallel/test-inspector-waiting-for-disconnect.js +++ b/test/parallel/test-inspector-waiting-for-disconnect.js @@ -41,4 +41,4 @@ async function runTest() { assert.strictEqual((await child.expectShutdown()).exitCode, 55); } -runTest(); +runTest().then(common.mustCall()); diff --git a/test/sequential/test-inspector-async-hook-setup-at-inspect-brk.js b/test/sequential/test-inspector-async-hook-setup-at-inspect-brk.js index 595f934c0238..f4f45a1aa8f4 100644 --- a/test/sequential/test-inspector-async-hook-setup-at-inspect-brk.js +++ b/test/sequential/test-inspector-async-hook-setup-at-inspect-brk.js @@ -46,4 +46,4 @@ async function runTests() { assert.strictEqual((await instance.expectShutdown()).exitCode, 55); } -runTests(); +runTests().then(common.mustCall()); diff --git a/test/sequential/test-inspector-async-hook-setup-at-signal.js b/test/sequential/test-inspector-async-hook-setup-at-signal.js index a52627e5012f..259a40db976e 100644 --- a/test/sequential/test-inspector-async-hook-setup-at-signal.js +++ b/test/sequential/test-inspector-async-hook-setup-at-signal.js @@ -81,4 +81,4 @@ async function runTests() { instance.kill(); } -runTests(); +runTests().then(common.mustCall()); diff --git a/test/sequential/test-inspector-async-stack-traces-promise-then.js b/test/sequential/test-inspector-async-stack-traces-promise-then.js index f9a30e3f5471..40b05c9aacf3 100644 --- a/test/sequential/test-inspector-async-stack-traces-promise-then.js +++ b/test/sequential/test-inspector-async-stack-traces-promise-then.js @@ -68,4 +68,4 @@ function assertArrayIncludes(actual, expected) { `Expected ${actualString} to contain ${expectedString}.`); } -runTests(); +runTests().then(common.mustCall()); diff --git a/test/sequential/test-inspector-async-stack-traces-set-interval.js b/test/sequential/test-inspector-async-stack-traces-set-interval.js index ee37a654958c..97b2917b7009 100644 --- a/test/sequential/test-inspector-async-stack-traces-set-interval.js +++ b/test/sequential/test-inspector-async-stack-traces-set-interval.js @@ -44,4 +44,4 @@ async function runTests() { instance.kill(); } -runTests(); +runTests().then(common.mustCall()); diff --git a/test/sequential/test-inspector-break-e.js b/test/sequential/test-inspector-break-e.js index 6aae729977b5..f2a52fcae835 100644 --- a/test/sequential/test-inspector-break-e.js +++ b/test/sequential/test-inspector-break-e.js @@ -18,4 +18,4 @@ async function runTests() { assert.strictEqual((await instance.expectShutdown()).exitCode, 0); } -runTests(); +runTests().then(common.mustCall()); diff --git a/test/sequential/test-inspector-break-when-eval.js b/test/sequential/test-inspector-break-when-eval.js index 371a60daaf62..7a834e9934b1 100644 --- a/test/sequential/test-inspector-break-when-eval.js +++ b/test/sequential/test-inspector-break-when-eval.js @@ -75,4 +75,4 @@ async function runTests() { assert.strictEqual((await child.expectShutdown()).exitCode, 0); } -runTests(); +runTests().then(common.mustCall()); diff --git a/test/sequential/test-inspector-console.js b/test/sequential/test-inspector-console.js index 15e2e2e8f639..bb0f0ce42a3d 100644 --- a/test/sequential/test-inspector-console.js +++ b/test/sequential/test-inspector-console.js @@ -34,4 +34,4 @@ async function runTest() { session.disconnect(); } -runTest(); +runTest().then(common.mustCall()); diff --git a/test/sequential/test-inspector-contexts.js b/test/sequential/test-inspector-contexts.js index 8c7a68d4650d..9cdf2d0017c4 100644 --- a/test/sequential/test-inspector-contexts.js +++ b/test/sequential/test-inspector-contexts.js @@ -163,4 +163,7 @@ async function testBreakpointHit() { await pausedPromise; } -testContextCreatedAndDestroyed().then(common.mustCall(testBreakpointHit)); +(async function() { + await testContextCreatedAndDestroyed(); + await testBreakpointHit(); +})().then(common.mustCall()); diff --git a/test/sequential/test-inspector-debug-brk-flag.js b/test/sequential/test-inspector-debug-brk-flag.js index f281f2c09ce4..f1312b47ad8d 100644 --- a/test/sequential/test-inspector-debug-brk-flag.js +++ b/test/sequential/test-inspector-debug-brk-flag.js @@ -27,7 +27,7 @@ async function testBreakpointOnStart(session) { } async function runTests() { - const child = new NodeInstance(['--inspect', '--debug-brk']); + const child = new NodeInstance(['--inspect', '--inspect-brk']); const session = await child.connectInspectorSession(); await testBreakpointOnStart(session); @@ -36,4 +36,4 @@ async function runTests() { assert.strictEqual((await child.expectShutdown()).exitCode, 55); } -runTests(); +runTests().then(common.mustCall()); diff --git a/test/sequential/test-inspector-debug-end.js b/test/sequential/test-inspector-debug-end.js index 789fe9c76323..f3e343a0dadb 100644 --- a/test/sequential/test-inspector-debug-end.js +++ b/test/sequential/test-inspector-debug-end.js @@ -41,4 +41,4 @@ async function runTest() { await testSessionNoCrash(); } -runTest(); +runTest().then(common.mustCall()); diff --git a/test/sequential/test-inspector-exception.js b/test/sequential/test-inspector-exception.js index 9a453eb7deb9..f1cd2eca3f30 100644 --- a/test/sequential/test-inspector-exception.js +++ b/test/sequential/test-inspector-exception.js @@ -41,4 +41,4 @@ async function runTest() { assert.strictEqual((await child.expectShutdown()).exitCode, 1); } -runTest(); +runTest().then(common.mustCall()); diff --git a/test/sequential/test-inspector-ip-detection.js b/test/sequential/test-inspector-ip-detection.js index 6af06bb48283..333749de3c13 100644 --- a/test/sequential/test-inspector-ip-detection.js +++ b/test/sequential/test-inspector-ip-detection.js @@ -43,4 +43,4 @@ async function test() { instance.kill(); } -test(); +test().then(common.mustCall()); diff --git a/test/sequential/test-inspector-not-blocked-on-idle.js b/test/sequential/test-inspector-not-blocked-on-idle.js index 032efd6a9f62..fbf26d15c91f 100644 --- a/test/sequential/test-inspector-not-blocked-on-idle.js +++ b/test/sequential/test-inspector-not-blocked-on-idle.js @@ -17,4 +17,4 @@ async function runTests() { node.kill(); } -runTests(); +runTests().then(common.mustCall()); diff --git a/test/sequential/test-inspector-overwrite-config.js b/test/sequential/test-inspector-overwrite-config.js index 49f48a59a04b..c20df0832561 100644 --- a/test/sequential/test-inspector-overwrite-config.js +++ b/test/sequential/test-inspector-overwrite-config.js @@ -41,4 +41,4 @@ async function runTests() { assert.ok(asserted, 'log statement did not reach the inspector'); } -runTests(); +runTests().then(common.mustCall()); diff --git a/test/sequential/test-inspector-resource-name-to-url.js b/test/sequential/test-inspector-resource-name-to-url.js index 41a98ba219b2..0465c065b963 100644 --- a/test/sequential/test-inspector-resource-name-to-url.js +++ b/test/sequential/test-inspector-resource-name-to-url.js @@ -37,4 +37,4 @@ common.skipIfInspectorDisabled(); const { params: { url } } = await promise; strictEqual(url, expected); } -})(); +})().then(common.mustCall()); diff --git a/test/sequential/test-inspector-runtime-evaluate-with-timeout.js b/test/sequential/test-inspector-runtime-evaluate-with-timeout.js index b20aa77a5d5b..84dff6cdd9c3 100644 --- a/test/sequential/test-inspector-runtime-evaluate-with-timeout.js +++ b/test/sequential/test-inspector-runtime-evaluate-with-timeout.js @@ -22,4 +22,4 @@ common.skipIfInspectorDisabled(); } ); session.disconnect(); -})(); +})().then(common.mustCall()); diff --git a/test/sequential/test-inspector-scriptparsed-context.js b/test/sequential/test-inspector-scriptparsed-context.js index 3a4c3f84692b..e656436879ce 100644 --- a/test/sequential/test-inspector-scriptparsed-context.js +++ b/test/sequential/test-inspector-scriptparsed-context.js @@ -83,4 +83,4 @@ async function runTests() { assert.strictEqual((await instance.expectShutdown()).exitCode, 0); } -runTests(); +runTests().then(common.mustCall()); diff --git a/test/sequential/test-inspector-stop-profile-after-done.js b/test/sequential/test-inspector-stop-profile-after-done.js index e242658e296d..f81884ecfd4e 100644 --- a/test/sequential/test-inspector-stop-profile-after-done.js +++ b/test/sequential/test-inspector-stop-profile-after-done.js @@ -27,4 +27,4 @@ async function runTests() { assert.strictEqual((await child.expectShutdown()).exitCode, 0); } -runTests(); +runTests().then(common.mustCall()); diff --git a/test/sequential/test-inspector-stress-http.js b/test/sequential/test-inspector-stress-http.js index 8d4a2db9570a..c038b7832ef6 100644 --- a/test/sequential/test-inspector-stress-http.js +++ b/test/sequential/test-inspector-stress-http.js @@ -28,4 +28,4 @@ async function runTest() { return child.kill(); } -runTest(); +runTest().then(common.mustCall()); diff --git a/test/sequential/test-inspector.js b/test/sequential/test-inspector.js index b5ced631643d..a1ef109cf1a9 100644 --- a/test/sequential/test-inspector.js +++ b/test/sequential/test-inspector.js @@ -314,4 +314,4 @@ async function runTest() { ); } -runTest(); +runTest().then(common.mustCall());