Skip to content

Commit

Permalink
test: warn when inspector process crashes
Browse files Browse the repository at this point in the history
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 <mmarchini@netflix.com>

PR-URL: #32133
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
mmarchini authored and MylesBorins committed Mar 9, 2020
1 parent 710c905 commit 6f9f2c5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/common/inspector-helper.js
Expand Up @@ -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;
});
Expand Down

0 comments on commit 6f9f2c5

Please sign in to comment.