From 6f9f2c5de489884a162a5b92269e0066a49e5ad4 Mon Sep 17 00:00:00 2001 From: Matheus Marchini Date: Fri, 6 Mar 2020 16:13:00 -0800 Subject: [PATCH] test: warn when inspector process crashes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the subprocess being inspected hard crashes, there will be no information on the log, and the parent process will just wait until timeout. Logging the error signal when it happens can help developers understand failures faster. Signed-off-by: Matheus Marchini PR-URL: https://github.com/nodejs/node/pull/32133 Reviewed-By: Michaƫl Zasso Reviewed-By: Jiawen Geng Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell --- test/common/inspector-helper.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/common/inspector-helper.js b/test/common/inspector-helper.js index 42d6baed4410de..d430137746dd81 100644 --- a/test/common/inspector-helper.js +++ b/test/common/inspector-helper.js @@ -344,6 +344,9 @@ class NodeInstance extends EventEmitter { this._shutdownPromise = new Promise((resolve) => { this._process.once('exit', (exitCode, signal) => { + if (signal) { + console.error(`[err] child process crashed, signal ${signal}`); + } resolve({ exitCode, signal }); this._running = false; });