Repository navigation
tests: make GPU/CPU parity checks robust to a late frame - #86
Merged
Merged
Conversation
_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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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.
Fixes the one failure on
mainafter #85 merged:TestGpuMousePanParity::test_wheel_zoom_then_drag_panfailed on macOS / Python 3.13 only, with1001/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.
_settlewaits 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