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

Add number of timeouts in test summary #3021

Merged
merged 4 commits into from May 16, 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: 4 additions & 0 deletions lib/reporters/default.js
Expand Up @@ -659,6 +659,10 @@ 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.previousFailures > 0) {
this.lineWriter.writeLine(colors.error(`${this.previousFailures} previous ${plur('failure', this.previousFailures)} in test files that were not rerun`));
}
Expand Down
5 changes: 4 additions & 1 deletion lib/run-status.js
Expand Up @@ -125,7 +125,10 @@ export default class RunStatus extends Emittery {
case 'timeout':
event.pendingTests = this.pendingTests;
this.pendingTests = new Map();
stats.timeouts++;
for (const testsInFile of event.pendingTests.values()) {
stats.timeouts += testsInFile.size;
}

break;
case 'interrupt':
event.pendingTests = this.pendingTests;
Expand Down
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutinmultiplefiles.v12.log
Expand Up @@ -30,4 +30,5 @@
─

4 tests passed
5 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutinmultiplefiles.v14.log
Expand Up @@ -30,4 +30,5 @@
─

4 tests passed
5 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutinmultiplefiles.v16.log
Expand Up @@ -30,4 +30,5 @@
─

4 tests passed
5 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutinmultiplefiles.v17.log
Expand Up @@ -30,4 +30,5 @@
─

4 tests passed
5 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutinsinglefile.v12.log
Expand Up @@ -16,4 +16,5 @@
─

2 tests passed
2 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutinsinglefile.v14.log
Expand Up @@ -16,4 +16,5 @@
─

2 tests passed
2 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutinsinglefile.v16.log
Expand Up @@ -16,4 +16,5 @@
─

2 tests passed
2 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutinsinglefile.v17.log
Expand Up @@ -16,4 +16,5 @@
─

2 tests passed
2 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutwithmatch.v12.log
Expand Up @@ -14,4 +14,5 @@
─

1 test passed
2 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutwithmatch.v14.log
Expand Up @@ -14,4 +14,5 @@
─

1 test passed
2 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutwithmatch.v16.log
Expand Up @@ -14,4 +14,5 @@
─

1 test passed
2 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutwithmatch.v17.log
Expand Up @@ -14,4 +14,5 @@
─

1 test passed
2 tests remained pending after a timeout
---tty-stream-chunk-separator