Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Count timeouts separately from the timed out tests #3099

Merged
merged 1 commit into from Sep 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/reporters/default.js
Expand Up @@ -668,8 +668,8 @@ export default class Reporter {
this.lineWriter.writeLine(colors.error(`${this.stats.uncaughtExceptions} uncaught ${plur('exception', this.stats.uncaughtExceptions)}`));
}

if (this.stats.timeouts > 0) {
this.lineWriter.writeLine(colors.error(`${this.stats.timeouts} ${plur('test', this.stats.timeouts)} remained pending after a timeout`));
if (this.stats.timedOutTests > 0) {
this.lineWriter.writeLine(colors.error(`${this.stats.timedOutTests} ${plur('test', this.stats.timedOutTests)} remained pending after a timeout`));
}

if (this.previousFailures > 0) {
Expand Down
4 changes: 3 additions & 1 deletion lib/run-status.js
Expand Up @@ -33,6 +33,7 @@ export default class RunStatus extends Emittery {
selectedTests: 0,
sharedWorkerErrors: 0,
skippedTests: 0,
timedOutTests: 0,
timeouts: 0,
todoTests: 0,
uncaughtExceptions: 0,
Expand Down Expand Up @@ -124,10 +125,11 @@ export default class RunStatus extends Emittery {
this.removePendingTest(event);
break;
case 'timeout':
stats.timeouts++;
event.pendingTests = this.pendingTests;
this.pendingTests = new Map();
for (const testsInFile of event.pendingTests.values()) {
stats.timeouts += testsInFile.size;
stats.timedOutTests += testsInFile.size;
}

break;
Expand Down