Repository navigation
animations: allow WebKit's microsecond duration rounding in the confetti timing test - #345220
Bryan Chen (bryanchen-d) wants to merge 1 commit into
Conversation
|
Lee Murray (@mrleemurray) this is a test-only follow-up to #345182. The confetti timing check failed on main CI's WebKit job (491287). WebKit reports
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the test-only adjustment accommodating WebKit duration rounding.
No open issues 🎉
What changed in this PR
This test-only change addresses intermittent WebKit failures in the confetti animation timing test by allowing for microsecond rounding of reported durations. Production animation behavior is unchanged.
Changes:
- Increases the timing tolerance from
1e-10to1e-3ms while retaining the existing timing checks. - Adds a comment explaining why WebKit needs the tolerance.
| File | Description |
|---|---|
src/vs/base/test/browser/ui/animations/animations.test.ts |
Adjusts the confetti timing assertion tolerance and documents WebKit’s duration rounding. |
Review effort: Balanced
|
Bryan Chen (@bryanchen-d) gotcha, thanks for updating this! |
…tti timing test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
f232684 to
cdc2ff4
Compare
|
Closing this as a duplicate of #345214, which merged the same
|
Main CI 491287 failed on macOS ARM64
Run unit tests (Browser, Webkit)withAnimations › creates consecutive pixelated rainbow confetti animations, whereallParticlesUseBalancedTimingwasfalse. The same commit passed in the previous main CI.Cause
triggerConfettiAnimationcomputes each keyframe offset astime / duration, using the full-precision random duration (for example1490.6732…). The test multiplies the offset step byeffect.getTiming().durationand requires the result to be<= 40 + 1e-10. WebKit reports that duration rounded to whole microseconds (1490.673). Whenever the rounding goes up, each 40 ms step reads as up to about1e-5ms longer, which fails the1e-10tolerance. The duration is random, so the test fails about half the time on WebKit. Chromium and Electron report the exact value.I confirmed this in local WebKit with a temporary probe over 40 animations. Every failing case had
dwith exactly 3 decimals andmaxGap − 40between5e-6and1.3e-5, while easing, keyframe counts and duration bounds were all fine.Change (test only)
The tolerance goes from
1e-10to1e-3ms, which covers microsecond rounding, and a comment says why. That's still 4 orders of magnitude tighter than anything visible, so the test still checks that the steps are 40 ms. The product is unchanged.Validation (local,
--run animations.test.ts)