Skip to content

test(palette-machines): push the next history entry only after the app wrote the Forward one - #3649

Merged
devswha merged 1 commit into
mainfrom
fix/palette-machines-demo-flake
Nov 11, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/palette-machines-demo-flake

Conversation

@devswha

@devswha devswha commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Change

Fixes a flaky browser script, scripts/palette-machines-demo-regression.ts ("TimeoutError: waitFor: Timeout 30000ms exceeded" at the wait for the New workspace · Laptop dialog). 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 own pushState could 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

  • In the self-hosted CI runner image (herdr-ci-runner:local), 4 loops on 3 CPUs, the same load on both sides: main failed 7 of 40 runs, all at the New workspace · Laptop wait; this branch failed 0 of 40.
  • bun run check fast on this branch, rebased on main 05567a0: pass (unit 16058 pass, 0 fail, 53 skip; typecheck, build, generated files ok).
  • Not run: check full, other browser scripts. Test-only, so no changelog fragment.

…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.
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Updated the creation-link browser test to verify that the Forward URL includes the expected name, pane, and working directory.

The creation-link browser test now waits for the Forward URL to include name=Forward, pane, and cwd. Its comment describes how the dialog’s PC and folder are written to the Forward entry.

Changes: Creation-link browser regression

Layer / File(s) Summary
Forward URL assertion
scripts/palette-machines-demo-regression.ts
The test waits for the Forward URL to include the entry name, pane, and folder state. The comment describes the dialog’s PC and folder being written to that entry.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Possibly related PRs

  • devswha/ovis#3614: Both changes cover browser history state during the New workspace dialog. This PR waits for the app-written pane and folder state before adding a history entry.
  • devswha/ovis#2718: Both changes cover creation links and the New workspace dialog. This PR stabilizes the regression test for pane and folder state updates.

Suggested reviewers: christso

Merge Risk: Minimal · up to 15308

The regression script waits for the Forward entry’s pane and folder before advancing history. No merge-blocking issue was established.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly identifies the main fix: delaying the next history entry until the app writes the Forward entry.
Description check Passed The description includes the required Change and Validation sections. It explains the flaky behavior, cause, fix, test results, passed checks, and skipped checks.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 911f159 and 15308d8.

Files selected for processing: 1

  • scripts/palette-machines-demo-regression.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

@devswha
devswha merged commit 301934f into main Nov 11, 2026
13 checks passed
@devswha

devswha commented Nov 11, 2026

Copy link
Copy Markdown
Owner Author

Merge pass

Merged head 15308d82582f as 301934f733cc on GitHub's checks, with no unresolved review threads.

Reviewer Verdict Note
codex CLEAR

One reviewer: test-only PR (one browser regression script).

Test-only PR (scripts/palette-machines-demo-regression.ts, four lines), so one reviewer: Codex Terra, CLEAR with no findings.

It closes a 30 s waitFor flake in that browser script: the script pushed the next history entry before the app had written the Forward one. The author's runs in the runner image were 7 of 40 failed on main and 0 of 40 with the fix. The evidence that the script passes at this head is its own Browser regression job.

@devswha
devswha deleted the fix/palette-machines-demo-flake branch November 11, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant