Skip to content

Commit

Permalink
fix(testrunner): do not spam output after termination (#1511)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgozman committed Mar 24, 2020
1 parent 3e8a6ac commit a2ee7a1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions utils/testrunner/TestRunner.js
Expand Up @@ -293,7 +293,8 @@ class TestWorker {
message = `${location} - Timeout Exceeded ${hook.timeout}ms while running "${hookName}" in suite "${suite.fullName}"`;
error = null;
} else if (error === TerminatedError) {
message = `${location} - TERMINATED while running "${hookName}" in suite "${suite.fullName}"`;
// Do not report termination details - it's just noise.
message = '';
error = null;
} else {
if (error.stack)
Expand Down Expand Up @@ -408,6 +409,8 @@ class TestPass {
for (const worker of this._workers)
worker.terminate(force /* terminateHooks */);
this._result.setResult(result, message);
if (this._result.message === 'SIGINT received' && message === 'SIGTERM received')
this._result.message = message;
if (error) {
if (error.stack)
await this._runner._sourceMapSupport.rewriteStackTraceWithSourceMaps(error);
Expand Down Expand Up @@ -439,7 +442,8 @@ class TestPass {

async _didFailHook(worker, suite, hook, hookName, message, error) {
debug('testrunner:hook')(`[${worker._workerId}] "${hookName}" FAILED for "${suite.fullName}" (${hook.location.fileName + ':' + hook.location.lineNumber})`);
this._result.addError(message, error, worker);
if (message)
this._result.addError(message, error, worker);
this._result.setResult(TestResult.Crashed, message);
}

Expand Down

0 comments on commit a2ee7a1

Please sign in to comment.