test: unflake sync predicate test (#6654)

Ensure that requests come in order by awaiting them.
This commit is contained in:
Dmitry Gozman 2021-05-19 09:05:32 -07:00 committed by GitHub
parent 754ee13c93
commit 8cc103f43e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,10 +91,10 @@ it('sync predicate should be only called once', async ({page, server}) => {
++counter;
return response.url() === server.PREFIX + '/digits/1.png';
}),
page.evaluate(() => {
fetch('/digits/1.png');
fetch('/digits/2.png');
fetch('/digits/3.png');
page.evaluate(async () => {
await fetch('/digits/1.png');
await fetch('/digits/2.png');
await fetch('/digits/3.png');
})
]);
expect(response.url()).toBe(server.PREFIX + '/digits/1.png');