Skip to content

test(third-party-impact): wait for the long frame, and say what the page saw on a failure - #293

Merged
nucliweb merged 1 commit into
mainfrom
test/loaf-wait-and-diagnose
Oct 21, 2026
Merged

nucliweb merged 1 commit into
mainfrom
test/loaf-wait-and-diagnose

Conversation

@nucliweb

Copy link
Copy Markdown
Owner

Summary

third-party-impact.test.js › "warns when one domain holds a large share of main-thread time" failed in CI on #284 and #290 with expected 0 to be greater than 250: the snippet attributed no time to the third-party script that blocks for 320 ms. A re-run passed both times.

It does not reproduce outside CI: 30 of 30 loads on a laptop, idle and with every core busy, and in Docker (Playwright 1.63.0, Linux, 2 CPUs) 60 of 60 loads with a diagnostic and 30 of 30 runs of the test while the whole e2e suite ran alongside.

Two causes fit the 0: the long animation frame reaches the timeline after the 500 ms the test waits, or it comes without the script. The test now:

  • waits up to 5 s for a long animation frame before it runs the snippet, instead of a fixed 500 ms, which covers the first cause;
  • on a failure, says how long it waited and lists the frames with their scripts (sourceURL, invokerType, duration), which tells the two causes apart if it fails again.

Test plan

  • Docker with mcr.microsoft.com/playwright:v1.63.0-noble and 2 CPUs: no failure in 60 loads and 30 runs with the suite in parallel, locally
  • Forced failure (threshold raised for the check, then restored): the message lists the wait (58 ms) and the frame with blocking.js, locally
  • The test file ten times in a row: 10/10 (21 tests each), and lint, locally
  • CI

…and say what the page saw

The test of the warning for a domain with a large share of main-thread time failed twice in CI with 0 ms for the blocking script, and never on a laptop or in Docker with Playwright 1.63, two CPUs and the whole e2e suite running at the same time (60 loads and 30 runs). Either the long animation frame reached the timeline after the fixed wait of 500 ms, or it came without the script.

The test now waits up to 5 seconds for a long animation frame instead of a fixed time, which covers the first case. If it fails again, its message says how long it waited and lists the frames of the page with their scripts, which tells the two cases apart.
@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
webperf-snippets Ready Ready Preview Oct 21, 2026 5:32pm UTC

@nucliweb
nucliweb merged commit 59791d9 into main Oct 21, 2026
3 checks passed
@nucliweb
nucliweb deleted the test/loaf-wait-and-diagnose branch October 21, 2026 18:26

This branch was successfully deployed

1 active deployment
Preview — bdcfb33b Deployed Oct 21, 2026 by vercel[bot]
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.

1 participant