Skip to content

test(gui): await the target-switch read before assertions - #818

Closed
luvs01 wants to merge 2 commits into
devfrom
fix/pool-target-switch-commit-wait
Closed

luvs01 wants to merge 2 commits into
devfrom
fix/pool-target-switch-commit-wait

Conversation

@luvs01

@luvs01 luvs01 commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

The account-pool target-switch regression test could assert before the new target's passive-effect read started. Wait for the layout commit and then the expected in-flight state, instead of assuming a zero-delay timer means the passive effect and its queued microtask have completed.

The old response is still released in the layout phase, preserving the regression window. Only the test helper changes; production code and existing assertions are unchanged.

Verification

Current head: 92bff195de8bf433f7ba0e0482c5dc9061d6cb1c.

  • Focused GUI file: 13 pass, 0 fail, 86 assertions, Bun 1.4.4.
  • GUI build: passed (TypeScript and standard/classic Vite bundles).
  • git diff --check: passed.
  • Independent read-only review confirmed the target reset, epoch guards, layout callback and in-flight observation preserve the original regression window.
  • Exact-head hosted CI passed: upstream and fork. The upstream run executed changed tests and gates; full OS matrices and desktop jobs were skipped. Independent maintainer re-review remains pending.
  • The maintainer's current review confirms this test-only diff needs no screenshot; this does not waive testing or independent maintainer review.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed (test-only change; none needed).
  • No runtime, account, credential or production UI changes.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The target-switch regression test now waits for the new target’s layout commit before it releases the previous target’s held read and resolves the switch promise.

Changes: Target-switch regression test

Layer / File(s) Summary
Synchronize release with layout commit
gui/tests/codex-account-pool-target-switch.test.tsx
The callback now releases the previous target’s held read and resolves the switch promise during the layout phase, after the new target’s commit.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Other

Suggested reviewers: lidge-jun

Merge Risk: Minimal · up to 87a04

This change only adjusts test synchronization, with no production behavior change. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
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.
Title check Passed The title "test(gui): await the target-switch read before assertions" matches the main change. The raw summary and PR objectives both say the regression test now waits for the new target's layout comm…
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "test(gui): await the target-switch read before assertions" matches the main change. The raw summary and PR objectives both say the regression test now waits for the new target's layout commit before observing post-switch state, and the previous read is released in the layout phase. The title names the test and the timing fix, and it does not describe unrelated work. It is specific enough for a teammate scanning history.

Finishing Touches

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 aa30ea9 and 87a04ca.

Files selected for processing: 1

  • gui/tests/codex-account-pool-target-switch.test.tsx

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

@github-actions

Copy link
Copy Markdown

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore label Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

✅ READY

  • all PR quality gates passed.

UI screenshot waived by a maintainer comment.

Hygiene

✅ Deterministic PR hygiene checks passed.

@luvs01

luvs01 commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner Author

No GUI changes: only the target-switch test harness is changed, with no rendered component or production UI change. Verified the single-file diff at 87a04ca. Apply the repository-supported OWNER screenshot false-positive override; no CI requirement is waived. Upstream review is lidge-jun#8592. This is the isolated repair for the account-pool target-switch timing failure in #817.

@luvs01

luvs01 commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner Author

No description provided.

The layout-commit wait still could not prove the new target's passive-effect read had started: the hook kicks it from a passive effect plus a queued microtask, so a trailing zero-delay timer could observe only two reads on a loaded runner (the still-open review finding).

Wait until the fixture's own in-flight state is painted instead: refreshing turns true only after the read's fetch was issued and React committed the new counter, so the timer becomes a yield between observations rather than an effect-ordering assumption. Releasing the old read stays in the layout phase, preserving the regression window.

Verified: bun test tests/codex-account-pool-target-switch.test.tsx -> 13 pass / 0 fail / 86 assertions (4 runs); bun run build (tsc -b + vite + vite classic) passed; git diff --check passed. Baseline and change both emit the same flaky not-wrapped-in-act noise, so none is introduced.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@luvs01 luvs01 changed the title test(gui): await target-switch commit before assertions test(gui): await the target-switch read before assertions Nov 16, 2026
@luvs01 luvs01 closed this Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant