test: unflake "beforeAll and afterAll should have a separate timeout" (#23263)

This commit is contained in:
Dmitry Gozman 2023-05-24 13:46:28 -07:00 committed by GitHub
parent 871032b411
commit 70589c0113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -703,26 +703,26 @@ test('beforeAll and afterAll should have a separate timeout', async ({ runInline
import { test, expect } from '@playwright/test';
test.beforeAll(async () => {
console.log('\\n%%beforeAll');
await new Promise(f => setTimeout(f, 300));
await new Promise(f => setTimeout(f, 1600));
});
test.beforeAll(async () => {
console.log('\\n%%beforeAll2');
await new Promise(f => setTimeout(f, 300));
await new Promise(f => setTimeout(f, 1600));
});
test('passed', async () => {
console.log('\\n%%test');
await new Promise(f => setTimeout(f, 300));
await new Promise(f => setTimeout(f, 1600));
});
test.afterAll(async () => {
console.log('\\n%%afterAll');
await new Promise(f => setTimeout(f, 300));
await new Promise(f => setTimeout(f, 1600));
});
test.afterAll(async () => {
console.log('\\n%%afterAll2');
await new Promise(f => setTimeout(f, 300));
await new Promise(f => setTimeout(f, 1600));
});
`,
}, { timeout: '500' });
}, { timeout: '3000' });
expect(result.exitCode).toBe(0);
expect(result.passed).toBe(1);
expect(result.outputLines).toEqual([