test: unflake "should give enough time for fixture teardown" (#22763)

This commit is contained in:
Dmitry Gozman 2023-05-02 17:40:10 -07:00 committed by GitHub
parent 5e02022dff
commit dee0f2791e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -415,19 +415,19 @@ test('should give enough time for fixture teardown', async ({ runInlineTest }) =
fixture: async ({ }, use) => { fixture: async ({ }, use) => {
await use(); await use();
console.log('\\n%%teardown start'); console.log('\\n%%teardown start');
await new Promise(f => setTimeout(f, 800)); await new Promise(f => setTimeout(f, 2000));
console.log('\\n%%teardown finished'); console.log('\\n%%teardown finished');
}, },
}); });
test('fast enough but close', async ({ fixture }) => { test('fast enough but close', async ({ fixture }) => {
test.setTimeout(1000); test.setTimeout(3000);
await new Promise(f => setTimeout(f, 800)); await new Promise(f => setTimeout(f, 2000));
}); });
`, `,
}); });
expect(result.exitCode).toBe(1); expect(result.exitCode).toBe(1);
expect(result.failed).toBe(1); expect(result.failed).toBe(1);
expect(result.output).toContain('Test finished within timeout of 1000ms, but tearing down "fixture" ran out of time.'); expect(result.output).toContain('Test finished within timeout of 3000ms, but tearing down "fixture" ran out of time.');
expect(result.outputLines).toEqual([ expect(result.outputLines).toEqual([
'teardown start', 'teardown start',
'teardown finished', 'teardown finished',