Repository navigation
test(e2e): the wheel fling settles on a rest within a pixel of a row and is released inside one task - #574
Merged
Conversation
…and is released inside one task
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.
wheel-column.spec.ts"a fast mouse fling coasts past where the pointer let go" failed on CI (plain cell, chromium) withexpect.poll(...).toBeLessThanOrEqual(1)receiving 29 after the 10 s timeout. Two timing weaknesses in the test, no component bug:settle()read a legal rest as unsettled.WheelColumn.commit()only rolls to the row when the drum is more than 1px off it, so a coast that ends 1px short of a row (scrollTop = 30k - 1) is left there.settle()checkedscrollTop % 30 <= 1, which reads that rest as 29 and polled to the timeout. It now takes the distance to the nearest row.setTimeout(16). On a loaded machine a timer runs 100 ms+ late, one move is left in the window, the drag reads as stopped and does not coast. I hit this locally at load average ~30 (topstayed at 330,Expected: > 330). The fling is now played in one task with the gaps spun onperformance.now(), so nothing can land between events.A new test pins (1) without needing the race: a
scrollTopwrite 1px short of a row must stay put and count as settled.Reproduce: with the old
settle(),pnpm --dir playground test:e2e:plain --project=chromium --grep "rest 1px short"fails withReceived: 29.Verify:
settle()+ the new rest test: fails,Expected: <= 1 Received: 29pnpm --dir playground test:e2e:plain --project=chromium --grep "fast mouse fling" --repeat-each 10: 10 passed--grep "fast mouse fling|rest 1px short" --repeat-each 30: 60 passed (load average ~30 on the machine)pnpm --dir playground test:e2e:plain --project=chromium e2e/wheel-column.spec.ts: 10 passed, 1 skipped (the WebKit-only test)biome checkandtsc --noEmitinplayground/: cleanTested on: chromium, plain cell. Not tested: webkit (the fling tests skip there), the sw cells; CI gate.