Skip to content

tests: make GPU/CPU parity checks robust to a late frame - #86

Merged
CSSFrancis merged 1 commit into
mainfrom
fix/gpu-parity-flake
Oct 23, 2026
Merged

CSSFrancis merged 1 commit into
mainfrom
fix/gpu-parity-flake

Conversation

@CSSFrancis

Copy link
Copy Markdown
Owner

Fixes the one failure on main after #85 merged: TestGpuMousePanParity::test_wheel_zoom_then_drag_pan failed on macOS / Python 3.13 only, with 1001/131456 pixels (0.8%) differ. The other 2610 tests passed, and the same job passed on #84's merge just before.

Cause

The test checks that the GPU and Canvas2D pages reach the same zoom and centre before comparing pixels, and those checks passed. So both pages were in the same state and one hadn't finished drawing. _settle waits a fixed 150 ms plus two animation frames, and a loaded CI runner can take longer. It's the only failure in the last 40 Tests runs, and I couldn't reproduce it locally, even with Chromium's CPU throttled 6×.

Fix

A new _assert_page_parity(name, page_gpu, page_cpu) snapshots both pages. If they differ, it settles and snapshots again, for up to 3 s, then makes the same assertion as before. All live-page parity checks now use it. The array-based check in the detail-tile test is unchanged.

A real coordinate bug never converges, so it still fails. Putting the mirrored-v shader bug back (the regression this file guards) fails 13 of 14 tests. With the bug removed, all 14 pass on three runs. A passing check costs nothing extra.

Assisted-by: claude-code:claude-opus-5-5

_settle waits a fixed 150 ms, which a loaded CI runner can outlast: on
main (macOS / Python 3.13) test_wheel_zoom_then_drag_pan failed with
identical view states on both pages but 0.8 % of pixels different.
Compare live pages and re-snapshot for up to 3 s before failing.  A real
coordinate bug never converges: re-introducing the mirrored-v shader bug
still fails 13 of 14 tests.

Assisted-by: claude-code:claude-opus-5-5
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.07%. Comparing base (3dbe814) to head (3e8c28c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #86   +/-   ##
=======================================
  Coverage   92.07%   92.07%           
=======================================
  Files          42       42           
  Lines        5489     5489           
=======================================
  Hits         5054     5054           
  Misses        435      435           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CSSFrancis
CSSFrancis merged commit 466bdb0 into main Oct 23, 2026
12 checks passed
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