Repository navigation
test(browser): Fix flaky replay and tracing integration tests - #26478
Merged
Merged
Conversation
`replay/canvas/records` expected the canvas snapshot in segment 2. The snapshot can land in the segment of the click, and then segment 2 never exists. The test now collects segments until the snapshot arrives. `replay/multiple-pages` expected a fixed segment id after a page change. The old page can use up one id for a flush that it starts before it unloads. The test now waits for the first segment of the new page and counts the later ids from it.
- `reportPageLoaded/finalTimeout`: the final timeout starts at `Sentry.init()`, but the test measured from the time origin, so a slow page load broke the upper bound. - `long-animation-frame-enabled`: mousedown and click could share one long animation frame, which is then attributed to the wrong script. - `navigation-navigation-keypress`: a fixed 500 ms wait raced the redirect at 400 + 100 ms. - `dsc-txn-name-update`: the route pattern was `http://` and the page fetched `https://`, so the requests went to real DNS. - `fetch-track-stream-performance`: the body is complete when the headers arrive, so the stream span can end in the clock tick in which it starts.
Contributor
size-limit report 📦Compared: 1f490be (PR test merge using develop at 524bd26) Against: 524bd26 (develop) · base run #66453 ✅ Baseline matches: this diff contains only this PR's changes.
|
s1gr1d
marked this pull request as ready for review
November 17, 2026 13:37
51 tasks done
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.
What
Seven browser integration tests no longer depend on timing that the test does not control:
replay/canvas/recordsandreplay/multiple-pageswait for the segment that holds the data, not for a fixed segment id.reportPageLoaded/finalTimeout(both variants) measures fromSentry.init().long-animation-frame-enabled(both variants) puts mousedown and click into different frames.navigation-navigation-keypresswaits for the redirect URL, not for 500 ms.dsc-txn-name-updateroutes thehttps://URL that the page fetches.fetch-track-stream-performanceaccepts a stream span of 0 ms.Why
Each of these tests failed in CI in the last month without a defect in the SDK. Examples:
Sentry.init(), but the span starts at the time origin. A page load slower than 500 ms broke the< 3.5bound (5 runs).dsc-txn-name-updatesent its requests to real DNS, because the route pattern washttp://.Two assertions are wider than before, on purpose:
replay/multiple-pagesaccepts one of two segment ids after a page change, becausereplay.tsincrements the id before the send. The ids inside a page are still exact.fetch-track-stream-performanceuses>=. Playwright fulfills the route with a complete body, so a duration of 0 ms is correct there.Checked locally on Chromium and WebKit with 3 repeats. The
finalTimeouttests fail with a 2 s or 4 s timeout, and the canvas test fails when the canvas is not drawn.Ref #26477