From 7816e040df9e082b16c2cb2e443efafac3354841 Mon Sep 17 00:00:00 2001 From: Chemi Atlow Date: Fri, 11 Aug 2023 16:05:01 +0300 Subject: [PATCH] test: stabilize the inspector-open-dispose test Ref: https://ci.nodejs.org/job/node-test-commit-osx-arm/nodes\=osx11/12543/console, https://github.com/nodejs/reliability/issues/631 PR-URL: https://github.com/nodejs/node/pull/49000 Reviewed-By: Moshe Atlow Reviewed-By: Luigi Pinca --- .../test-inspector-open-dispose.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename test/{parallel => sequential}/test-inspector-open-dispose.mjs (91%) diff --git a/test/parallel/test-inspector-open-dispose.mjs b/test/sequential/test-inspector-open-dispose.mjs similarity index 91% rename from test/parallel/test-inspector-open-dispose.mjs rename to test/sequential/test-inspector-open-dispose.mjs index e562535e1a0fc9..d3add569c938c8 100644 --- a/test/parallel/test-inspector-open-dispose.mjs +++ b/test/sequential/test-inspector-open-dispose.mjs @@ -15,16 +15,16 @@ if (process.env.BE_CHILD) { child.once('message', common.mustCall((msg) => { assert.strictEqual(msg.cmd, 'started'); + assert.strictEqual(msg.url, undefined); - child.send({ cmd: 'open', args: [] }); + child.send({ cmd: 'open' }); child.once('message', common.mustCall(wasOpenedHandler)); })); function wasOpenedHandler(msg) { assert.strictEqual(msg.cmd, 'url'); - const port = url.parse(msg.url).port; + const { port } = url.parse(msg.url); ping(port, common.mustSucceed(() => { - // Inspector is already open, and won't be reopened, so args don't matter. child.send({ cmd: 'dispose' }); child.once('message', common.mustCall(wasDisposedWhenOpenHandler)); firstPort = port; @@ -35,7 +35,7 @@ if (process.env.BE_CHILD) { assert.strictEqual(msg.cmd, 'url'); assert.strictEqual(msg.url, undefined); ping(firstPort, (err) => { - assert(err); + assert(err, 'expected ping to inspector port to fail'); child.send({ cmd: 'dispose' }); child.once('message', common.mustCall(wasReDisposedHandler)); });