Isolate Claude CLI gating tests#2320
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 19, 2026, 12:30 AM ET / 04:30 UTC. Summary Reproducibility: yes. at source level: the PR identifies a concrete concurrent path where shutdown-fence tests mutate shared registry state while Claude login fixtures launch processes. The provided focused command is a plausible reproducer, but it was not rerun during this read-only review. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Retain the task-local registry isolation as the root-cause fix, keep Linux serialization limited to the flaky test suite, and merge after the exact-head macOS/Linux matrix confirms the reported focused and full-suite behavior. Do we have a high-confidence way to reproduce the issue? Yes, at source level: the PR identifies a concrete concurrent path where shutdown-fence tests mutate shared registry state while Claude login fixtures launch processes. The provided focused command is a plausible reproducer, but it was not rerun during this read-only review. Is this the best way to solve the issue? Yes. Task-local test state addresses the shared mutable-state cause more directly than broad serialization, while suite serialization remains limited to the separately flaky Linux gating fixture group. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 242469b5b23e. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Merged as Root cause: Fix: the active-process registry now resolves through a task-local isolated Verification:
|
Summary
TTYCommandRunnerActiveProcessRegistrybehind a task-local state override so shutdown-fence tests cannot reject unrelated concurrent Claude login launchesPlatformGatingTestssuite, completing the partial Claude CLI gating serialization from Serialize flaky Claude CLI platform-gating cases #2311Root cause
TTYCommandRunnerEnvTestsis serialized only within its own suite. Its shutdown-fence cases mutate the process-globalTTYCommandRunnerActiveProcessRegistry.isShuttingDownflag, whileClaudeLoginRunnerTestsconcurrently callTTYCommandRunner.run. When the fence wins,beginLaunch()rejects the Claude fixture launch and all three login tests receivelaunchFailed/empty output instead of their expected auth link or exit result.The exact concurrent reproducer was:
It failed before the fix and now passes all 31 tests. The isolated registry state is task-local; the one test that crosses to a detached
Threadexplicitly captures its scoped state.The Linux gating failure is a neighboring isolation class: #2311 serialized only the parameterized logged-out test's argument cases, not that test against the rest of
PlatformGatingTests. Suite-level serialization closes that gap, while task-local auth timeout control keeps slow arm64 fake-CLI fixtures inside a test-only budget.Verification
swift test --filter ClaudeLoginRunnerTestsswift test --filter 'ClaudeLoginRunnerTests|TTYCommandRunnerEnvTests'— 31 tests passedPlatformGatingTests— 10 consecutive focused runs passedswift build -c release— passed in 218.64smake check— SwiftFormat clean; SwiftLint 0 violations in 1,577 filesmake testruns on the final debug implementation:swift test -c releasewas also attempted after making the new seams configuration-independent. It compiled past this patch and then hit existing unrelated DEBUG-only OAuth test seams inClaudeOAuthDelegatedRefreshLinuxTests; the production release build is green.No changelog edit here; this is an internal test-infrastructure fix.