Skip to content

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

Draft
luvs01 wants to merge 1 commit into
devfrom
fix/pool-target-switch-commit-wait
Draft

luvs01 wants to merge 1 commit 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 can inspect the old render before React commits the requested target. Fork CI observed two reads instead of three in the in-flight-count case, and the same failure reproduced locally.

Wait for the probe's layout-effect callback before taking the post-switch observation. The old response is still released inside that layout effect, preserving the race before passive effects that the test is meant to cover. No production UI, account behavior, timeout or assertion changes.

Verification

  • Before: the focused old-visit in-flight-count case failed locally (expected 3 reads, received 2), matching https://github.com/luvs01/opencodex/actions/runs/43181833685/job/131059730115.
  • After: bun test tests/codex-account-pool-target-switch.test.tsx in gui/: 13 pass, 0 fail, 86 assertions, Bun 1.4.4.
  • bun run build in gui/: passed (TypeScript and standard/classic Vite bundles).
  • git diff --check: passed.
  • Full GUI tests/lint not repeated locally due shared storage contention; current-head hosted CI passed in both repositories (upstream run 43187443405; fork run 43187437391). There is no visual change to capture. The repository-supported screenshot exemption is recorded in the upstream collaborator comment and the fork owner comment; no testing requirement is waived.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed (test-only change; none needed).
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults (no runtime or credential 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
Title check Passed The title "test(gui): await target-switch commit before assertions" matches the main change. The PR changes only the target-switch regression test so it waits for the new target's layout commit before…
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "test(gui): await target-switch commit before assertions" matches the main change. The PR changes only the target-switch regression test so it waits for the new target's layout commit before asserting. The title names the test scope (gui), the change (await commit), and the purpose (before assertions). It does not list files, and it is not vague.

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.

This branch has not been deployed

No deployments
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