Repository navigation
test(palette-machines): push the next history entry only after the app wrote the Forward one - #3649
Conversation
…p wrote the Forward one The demo step that steps Forward onto a creation-only link waited for the dialog alone, then pushed the next entry with history.pushState. The app writes where the dialog opened (Build PC's fallback pane and that pane's folder from the dialog's draft) over its entry a few renders later; on a loaded runner that write landed on the entry the script had just pushed, so Forward asked for Build PC again and the wait for the Laptop dialog timed out (TimeoutError: waitFor: Timeout 30000ms exceeded). Wait until the address names that pane and folder before pushing. Real Back and Forward reach the write through popstate (#3614); only the script's own pushState could slip in before it. In herdr-ci-runner:local, 4 loops on 3 CPUs: 7 of 40 runs failed before, 0 of 40 after.
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Merge passMerged head
One reviewer: test-only PR (one browser regression script). Test-only PR ( It closes a 30 s |
Change
Fixes a flaky browser script,
scripts/palette-machines-demo-regression.ts("TimeoutError: waitFor: Timeout 30000ms exceeded" at the wait for theNew workspace · Laptopdialog). It failed or needed a second run 8 times in 24 h of CI (bun scripts/ci-flakes.ts), most recently run 42908778955.Cause
A race in the script, not in the app. The step that goes Forward onto a creation-only link waited only for the dialog, then pushed the next entry with
history.pushState. A few renders after the dialog opens, the app writes where it opened (the Build PC fallback pane and that pane's folder) over its own history entry. On a loaded runner, that write landed on the entry the script had just pushed. Forward then asked for Build PC again, and the wait for the Laptop dialog timed out.Real Back and Forward reach that write through
popstate(#3614); only the script's ownpushStatecould slip in before it.Fix
Before pushing, the script waits until the address names the Forward entry's pane and folder. No sleep, no longer timeout, no retry.
Validation
herdr-ci-runner:local), 4 loops on 3 CPUs, the same load on both sides:mainfailed 7 of 40 runs, all at theNew workspace · Laptopwait; this branch failed 0 of 40.bun run check faston this branch, rebased on main 05567a0: pass (unit 16058 pass, 0 fail, 53 skip; typecheck, build, generated files ok).check full, other browser scripts. Test-only, so no changelog fragment.