Skip to content

test(drawing): prove the sibling pick by the press, not a 200ms clock (MSTUD-1547) - #13

Merged
Boowman merged 1 commit into
mainfrom
MSTUD-1547/reorder-click-wait
Nov 29, 2026
Merged

Boowman merged 1 commit into
mainfrom
MSTUD-1547/reorder-click-wait

Conversation

@Boowman

@Boowman Boowman commented Nov 29, 2026

Copy link
Copy Markdown

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 with TimeoutError: Waiting failed: 200ms exceeded at 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)

  • Reproduced first. CPU burners alone (load 66): 5 of 5 passed. Throttling the page's own CPU (page.emulateCPUThrottling, scratch copy) reproduced the CI error exactly: 20x and 40x fail with Waiting failed: 200ms exceeded at line 416; 4x and 8x pass.
  • After. The new test passes at 20x and 40x throttle.
  • Still catches the bug it guards. With fix(canvas): keep the selection outline on an element that is still transitioning doop-design/doop#559's fix reverted in a scratch copy (if (standalone) return false in ElementMove.tsx, so a press inside an entered standalone group no longer picks), the new test fails.
  • Loaded runs (24 CPU burners, load 54 to 120), whole file, 10 runs. The target test passed 10 of 10. One run failed a different test in the same file, "keeps fast layer drags and cancellation correct while doop:style-gesture is delayed" (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.
  • groupDrawnBrowser "picks a group with a click and goes into it with a double-click": 10 of 10 loaded runs (whole file) passed. It also passed at 4x, 20x and 40x throttle, and 3 of 3 at 20x with the grouping save held back 1.5 s. Not changed.
  • Full suite at a43bb89. msi-work: 4,644 passed, 0 failed (one earlier run there failed inlineData.test.ts once, 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.ts could 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, add await page.emulateCPUThrottling(20) after pages.open() in tests/drawingPage.ts and run the test on main.

Size

Production lines: 0. Test lines: +9 / -5 in tests/drawingReorderBrowser.test.ts. Reuses the test's existing seen recorder and settle. No new test file.

Ticket: MSTUD-1547

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
@Boowman Boowman added the bug Something isn't working label Nov 29, 2026
@Boowman Boowman self-assigned this Nov 29, 2026
@Boowman
Boowman merged commit 838f5e6 into main Nov 29, 2026
1 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant