Skip to content

Commit ee81b18

Browse files
committed
Don't restart timeout timer when 'timeout' is emitted
It can take longer for workers to exit than the timeout period, in which case restarting the timeout timer just causes it to fire again.
1 parent fce6d07 commit ee81b18

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

api.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ class Api extends Emittery {
9898
}
9999

100100
runStatus.on('stateChange', record => {
101-
// Restart the timer whenever there is activity.
102-
restartTimer();
101+
if (record.type !== 'timeout') {
102+
// Restart the timer whenever there is non-timeout activity.
103+
restartTimer();
104+
}
103105

104106
if (failFast && (record.type === 'hook-failed' || record.type === 'test-failed' || record.type === 'worker-failed')) {
105107
// Prevent new test files from running once a test has failed.

0 commit comments

Comments
 (0)