Skip to content

test(webview): add a timeout for clearCookies in teardown so a busy page can't stall it#41416

Open
dcrousso wants to merge 1 commit into
microsoft:mainfrom
dcrousso:fix-WKWebView-page-timeout
Open

test(webview): add a timeout for clearCookies in teardown so a busy page can't stall it#41416
dcrousso wants to merge 1 commit into
microsoft:mainfrom
dcrousso:fix-WKWebView-page-timeout

Conversation

@dcrousso

Copy link
Copy Markdown
Contributor

tests/page/page-set-content.spec.ts:153:3 › should handle timeout properly will infinitely loop the page

as a result, none of the WebKit inspector protocol messages are handled

context.clearCookies performs multiple round-trips using the WebKit inspector protocol (Page.getCookies and then Page.deleteCookie for each)

when the page is busy, we will end up waiting indefinitely

… page can't stall it

`tests/page/page-set-content.spec.ts:153:3 › should handle timeout properly` will infinitely loop the page

as a result, none of the WebKit inspector protocol messages are handled

`context.clearCookies` performs multiple round-trips using the WebKit inspector protocol (`Page.getCookies` and then `Page.deleteCookie` for each)

when the page is busy, we will end up waiting indefinitely
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

7380 passed, 1122 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

3 failed
❌ [chromium-library] › library/browsercontext-add-init-script.spec.ts:28 › should work without navigation, after all bindings @chromium-ubuntu-22.04-arm-node20
❌ [chromium-library] › library/browsercontext-expose-function.spec.ts:77 › should be callable from-inside addInitScript @chromium-ubuntu-22.04-arm-node20
❌ [firefox-page] › page/workers.spec.ts:40 › should emit created and destroyed events @firefox-ubuntu-22.04-node20

4 flaky ⚠️ [chromium-library] › library/chromium/chromium.spec.ts:434 › should produce network events, routing, and annotations for Service Worker (advanced) `@frozen-time-library-chromium-linux`
⚠️ [chromium-library] › library/popup.spec.ts:260 › should not throw when click closes popup `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:299 › should report intercepted service worker requests in HAR `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/video.spec.ts:717 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node20`

48925 passed, 1142 skipped


Merge workflow run.

// The shared Mobile Safari cookie store persists across tests; clear it
// while still on the test's domain (webview cookies are domain-scoped).
await page.context().clearCookies().catch(() => {});
await Promise.race([

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like the fix should be in clearCookies()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants