Skip to content

test(browser): Keep whitespace text out of the handlers-lcp page - #25280

Merged
JPeer264 merged 1 commit into
jp/flaky-nextjs-debug-build-mockfrom
jp/flaky-handlers-lcp-whitespace
Oct 14, 2026
Merged

JPeer264 merged 1 commit into
jp/flaky-nextjs-debug-build-mockfrom
jp/flaky-handlers-lcp-whitespace

Conversation

@JPeer264

Copy link
Copy Markdown
Member

This moves the button of the handlers-lcp test page into its own block, so the image is the only LCP candidate.

Why

The space between the inline <img> and <button> was painted as a text run in <body> (68 px²). When it painted in the same frame as the image, Chromium gave both LCP entries the same startTime. web-vitals calls its callback only when the LCP value changes, so the handlers never got the image entry, and window._LCP stayed at 68.

On Linux (Playwright v1.63.0 image, 8 workers), 3 of 60 and 3 of 120 runs failed before this change. After it, 120 of 120 passed.

Failed on CI: https://github.com/getsentry/sentry-javascript/actions/runs/38217884500/job/114713949461

@JPeer264
JPeer264 added this pull request to stack #25283 October 12, 2026 12:19
@JPeer264
JPeer264 marked this pull request as ready for review October 12, 2026 12:33
@JPeer264
JPeer264 requested a review from a team as a code owner October 12, 2026 12:33
@JPeer264
JPeer264 requested review from logaretm and msonnb and removed request for a team October 12, 2026 12:33
@JPeer264 JPeer264 self-assigned this Oct 12, 2026
@JPeer264
JPeer264 requested a review from Lms24 October 12, 2026 12:33
@JPeer264
JPeer264 force-pushed the jp/flaky-handlers-lcp-whitespace branch from 9b361b1 to aa72f30 Compare October 12, 2026 12:33

@Lms24 Lms24 left a comment

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.

Nice find! Tbh, not fully sure if asserting on the exact size is a good idea but if it differed by so much (68 vs. 107400) any "is in range" check would have failed here.

@JPeer264
JPeer264 removed this pull request from stack #25283 October 13, 2026 15:29
@JPeer264
JPeer264 added this pull request to stack #25335 October 13, 2026 15:29
The space between the inline <img> and <button> was painted as a text
run in <body> (68px²). When it painted in the same frame as the image,
Chromium emitted both LCP entries with the same startTime. web-vitals only
calls its callback when the LCP value changes, so the handlers never got
the image entry and window._LCP stayed at 68.

Put the button into its own block, so the image is the only LCP
candidate. On Linux (Playwright v1.63.0 image) the test failed 3 of 60
and 3 of 120 runs before, and passed 120 of 120 after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JPeer264
JPeer264 force-pushed the jp/flaky-handlers-lcp-whitespace branch from aa72f30 to 0b2aabe Compare October 13, 2026 15:36
@JPeer264
JPeer264 merged commit f47c08b into develop Oct 14, 2026
118 of 149 checks passed
@JPeer264
JPeer264 deleted the jp/flaky-handlers-lcp-whitespace branch October 14, 2026 06:56
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