mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
parent
2041aab010
commit
aa72b2b9bb
@ -186,7 +186,7 @@ export class Dispatcher {
|
|||||||
// Only retry expected failures, not passes and only if the test failed.
|
// Only retry expected failures, not passes and only if the test failed.
|
||||||
for (const testId of failedTestIds) {
|
for (const testId of failedTestIds) {
|
||||||
const pair = this._testById.get(testId)!;
|
const pair = this._testById.get(testId)!;
|
||||||
if (pair.test.expectedStatus === 'passed' && pair.test.results.length < pair.test.retries + 1) {
|
if (!this._isStopped && pair.test.expectedStatus === 'passed' && pair.test.results.length < pair.test.retries + 1) {
|
||||||
pair.result = pair.test._appendTestResult();
|
pair.result = pair.test._appendTestResult();
|
||||||
remaining.unshift({
|
remaining.unshift({
|
||||||
retry: pair.result.retry,
|
retry: pair.result.retry,
|
||||||
|
@ -63,3 +63,19 @@ test('-x should work', async ({ runInlineTest }) => {
|
|||||||
expect(result.failed).toBe(1);
|
expect(result.failed).toBe(1);
|
||||||
expect(result.output.split('\n').filter(l => l.includes('expect(')).length).toBe(2);
|
expect(result.output.split('\n').filter(l => l.includes('expect(')).length).toBe(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('max-failures should work with retries', async ({ runInlineTest }) => {
|
||||||
|
const result = await runInlineTest({
|
||||||
|
'a.spec.js': `
|
||||||
|
const { test } = pwt;
|
||||||
|
for (let i = 0; i < 10; ++i) {
|
||||||
|
test('fail_' + i, () => {
|
||||||
|
expect(true).toBe(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
}, { 'max-failures': 2, 'retries': 4 });
|
||||||
|
expect(result.exitCode).toBe(1);
|
||||||
|
expect(result.failed).toBe(1);
|
||||||
|
expect(result.output.split('\n').filter(l => l.includes('Received:')).length).toBe(2);
|
||||||
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user