From be7626bad8f54a8a608f9e82d54b8716a0d5628d Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Tue, 6 Dec 2022 17:59:44 +0100 Subject: [PATCH] chore: fix race in test Frame.waitForFunction should work when context is destroyed (#9368) Fixes the race condition which causes intermittent failures in Firefox because we haven't implemented bootstrap scripts to run on document creation. --- test/TestExpectations.json | 10 ++++++++-- test/src/waittask.spec.ts | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/test/TestExpectations.json b/test/TestExpectations.json index 22331e47605a9..b4c4b60b9cc25 100644 --- a/test/TestExpectations.json +++ b/test/TestExpectations.json @@ -2124,13 +2124,19 @@ "expectations": ["PASS", "FAIL"] }, { - "testIdPattern": "[waittask.spec] waittask specs Frame.waitForSelector should survive cross-process navigation", + "testIdPattern": "[waittask.spec] waittask specs Frame.waitForFunction should survive cross-process navigation", "platforms": ["darwin", "linux", "win32"], "parameters": ["firefox"], "expectations": ["PASS", "FAIL"] }, { - "testIdPattern": "[waittask.spec] waittask specs Frame.waitForFunction should survive cross-process navigation", + "testIdPattern": "[waittask.spec] waittask specs Frame.waitForFunction should work when resolved right before execution context disposal", + "platforms": ["darwin", "linux", "win32"], + "parameters": ["firefox"], + "expectations": ["SKIP"] + }, + { + "testIdPattern": "[waittask.spec] waittask specs Frame.waitForSelector should survive cross-process navigation", "platforms": ["darwin", "linux", "win32"], "parameters": ["firefox"], "expectations": ["PASS", "FAIL"] diff --git a/test/src/waittask.spec.ts b/test/src/waittask.spec.ts index 9254868b9a333..22ec85709b509 100644 --- a/test/src/waittask.spec.ts +++ b/test/src/waittask.spec.ts @@ -48,6 +48,7 @@ describe('waittask specs', function () { await page.waitForFunction(() => { if (!(globalThis as any).__RELOADED) { window.location.reload(); + return false; } return true; });