Repository navigation
test: tolerate delayed desktop compatibility fixture port release - #7897
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Retry runtime startup tests/clients/desktop-compatibility-runtime.test.ts |
After fixture listeners close, the test retries startup every 10 ms for up to one second when it receives the specified connection-unavailable error. It then checks the original PAC URL and stored connection identity, and stops the runtime. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Possibly related PRs
- lidge-jun/opencodex#7847: Addresses test races involving released loopback ports and later rebinding.
- lidge-jun/opencodex#7740: Removes a test’s dependence on reclaiming a released loopback port.
- lidge-jun/opencodex#7820: Addresses port reuse between remote messaging fixtures.
Suggested labels: chore
Suggested reviewers: luvs01
Merge Risk: 
Minimal · up to 31495
-
This test-only change adds bounded recovery retries without introducing a confirmed merge-blocking risk.
Pre-merge checks: 
5
-
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.
Comment @coderabbitai help to get the list of available commands.
Summary
desktop_compatibility_connection_unavailable, at 10 ms intervals with a one-second deadline. Other errors and a persistent bind failure still fail the test.01fa48af0004117e75c58dcc3460067ec8df7203:error: desktop_compatibility_connection_unavailable, atsrc/codex/desktop-compatibility/runtime.ts:150:33, called from the post-conflict restart attests/clients/desktop-compatibility-runtime.test.ts:495:24. The log wraps the underlying bind error, so it does not independently establish the OS-level cause.origin/devat1f840573466667fc97e881d11c2bba7d5828b737.Verification
Windows, Bun 1.4.4. All Bun test invocations ran sequentially with
$env:OCX_TEST_NO_QUEUE = '1'.bun test tests/clients/desktop-compatibility-runtime.test.ts --test-name-pattern 'a reused port conflict' --rerun-each 100— 100 pass, 0 fail, 1,000 assertions. The CI flake was not locally reproducible; no local red-before-green claim. An earlier attempt could not load missingzod/v4;bun install --frozen-lockfileinstalled the locked dependencies without a tracked change before this baseline run.bun test tests/clients/desktop-compatibility-runtime.test.ts tests/ci-workflows/file-size-ratchet.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts— 105 pass, 0 fail, 1,086 assertions.bun run typecheck— no type errors in 2,227 files.bun run privacy:scan— passed.git diff --check— passed.The test no longer requires port reuse to succeed on the first scheduling turn after fixture closure: it requires an actual successful start within the bounded release window, followed by the original PAC URL and identity checks. The intentionally occupied-port starts are never retried. The adjacent cached-PAC restart test still requires immediate stop/start without this retry. This handles a transient release delay while retaining failure for unavailable ports and unrelated lifecycle errors.
NOT RUN: full local suite (disproportionate for this one-test harness edit amid concurrent worktrees; focused runtime coverage and all requested guards ran), local Linux/macOS reproduction, and native desktop application smoke. Broader PR validation is left to normal CI; no CI rerun or manual workflow dispatch was requested.
Checklist
Summary by CodeRabbit