chore: ensure max failures exit yields erroneous status code (#30120)
Fixes https://github.com/microsoft/playwright/issues/30118
This commit is contained in:
parent
c27ec77d55
commit
0bf635ecce
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue