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 <[email protected]>

PR-URL: #32133
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • 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
Original file line number Diff line number Diff line change
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.