test(e2e): work around Playwright WebKit click and session bugs#4616
Draft
rgaignault wants to merge 1 commit into
Draft
test(e2e): work around Playwright WebKit click and session bugs#4616rgaignault wants to merge 1 commit into
rgaignault wants to merge 1 commit into
Conversation
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 4f6c97d | Docs | Datadog PR Page | Give us feedback! |
mormubis
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Running the e2e suite with
--project=webkitcurrently fails on some click-action and session-dependent scenario. Two unrelated quirks in Playwright's WebKit fork combine to silently break the SDK:PointerEvent.timeStampreturns a Cocoa-epoch-derived value (~8e11 ms) instead of aDOMHighResTimeStamp. The SDK feeds it intorelativeToClocks(...)intrackClickActions, computes a click-start ~25 years in the future, and the "clock looks weird" guard discards every click.window.cookieStore.set()resolves without error but does not persist. The next poll sees an empty cookie,handleStateChangetreats it as an expired session within ~50ms, and every later event is dropped by the session/view assembly hook.Changes
WEBKIT_PLAYWRIGHT_WORKAROUNDinit script intest/e2e/lib/framework/createTest.ts.context.addInitScript(...)indeclareTestwhenbrowserName === 'webkit'.The workaround wraps
Event.prototype.timeStampto fall back toperformance.now()when the raw value is implausibly large (>1 year), and removeswindow.cookieStoreso the SDK takes itsdocument.cookiefallback (which works correctly on Playwright WebKit). Scoped to test infrastructure — no SDK behaviour change.Test instructions
yarn playwright test --config test/e2e/playwright.config.ts --project=webkit test/e2e/scenario/rum/actions.scenario.tsshould pass all three variants. Without this change, all three fail.Checklist