Repository navigation
test(drawing): prove the sibling pick by the press, not a 200ms clock (MSTUD-1547) - #13
Merged
Merged
Conversation
The test waited 200ms after a click for the pick, to show it came from the press and not from the click's 250ms probe. On a busy machine the press alone took longer than 200ms (reproduced with the page's CPU throttled 20x). It now holds the button down and waits for the pick before releasing: the probe only starts on release, so the order is the proof. MSTUD-1547
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.
What and why
drawingReorderBrowser"picks a sibling of the picked shape on the press, never the whole group in between" failed in two full runs on a loaded Mac withTimeoutError: Waiting failed: 200ms exceededat line 416.The test clicked, then gave the pick 200 ms. That bound was meant to show the pick came from the press, not from the click's 250 ms probe. But on a busy machine the press alone takes longer than 200 ms, so a correct build failed.
The test now holds the button down and waits for the pick before releasing. The probe is only started by the release, so a pick that lands while the button is held came from the press. The order proves it, with no clock. The 500 ms settle after release and the check that the pick never passed through the group are unchanged. The app's 250 ms check is unchanged. Test code only.
Proof (logs kept with the ticket)
page.emulateCPUThrottling, scratch copy) reproduced the CI error exactly: 20x and 40x fail withWaiting failed: 200ms exceededat line 416; 4x and 8x pass.if (standalone) return falseinElementMove.tsx, so a press inside an entered standalone group no longer picks), the new test fails.expected 160 to be close to 220). It did not fail again at 4x, 10x or 20x throttle (3 runs each), and is not touched here.inlineData.test.tsonce, then passed). Mac: 4,612 passed, 2 failed (oidc.test.ts, covered by doop-fork#2;inspectorScrub.test.tsx"capped rate", a timing check not touched here).claudeExtension.test.tscould not start (spawnSync bun ENOENT; bun is not installed on that Mac).How to test
npx vitest run tests/drawingReorderBrowser.test.ts -t "picks a sibling". To see the old failure, addawait page.emulateCPUThrottling(20)afterpages.open()intests/drawingPage.tsand run the test onmain.Size
Production lines: 0. Test lines: +9 / -5 in
tests/drawingReorderBrowser.test.ts. Reuses the test's existingseenrecorder and settle. No new test file.Ticket: MSTUD-1547