chore: ensure max failures exit yields erroneous status code (#30120)

Fixes https://github.com/microsoft/playwright/issues/30118
This commit is contained in:
Pavel Feldman 2024-03-26 09:20:13 -07:00 committed by GitHub
parent c27ec77d55
commit 0bf635ecce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 8 deletions

View file

@ -229,13 +229,6 @@ export class Dispatcher {
await Promise.all(this._workerSlots.map(({ worker }) => worker?.stop()));
this._checkFinished();
}
private _reportTestEnd(test: TestCase, result: TestResult) {
this._reporter.onTestEnd(test, result);
this._failureTracker.onTestEnd(test, result);
if (this._failureTracker.hasReachedMaxFailures())
this.stop().catch(e => {});
}
}
class JobDispatcher {

View file

@ -49,6 +49,6 @@ export class FailureTracker {
}
result(): 'failed' | 'passed' {
return this._hasWorkerErrors || this._rootSuite?.allTests().some(test => !test.ok()) ? 'failed' : 'passed';
return this._hasWorkerErrors || this.hasReachedMaxFailures() || this._rootSuite?.allTests().some(test => !test.ok()) ? 'failed' : 'passed';
}
}