Repository navigation
Un-deadlock CmxConnectivityPeerSessionTests (red swift-package-tests gate on main) - #10741
Conversation
…rSessionTests onePeerTraceUsesOneAliasAndOneEstablishedSessionEvent awaited a GatedConnectivitySessionBuilder dial that no line ever released, so the suite hung until the 300s CI timeout, twice, failing swift-package-tests on main since at least Aug 19 (run 32212616081). Release the gate the way the neighboring concurrent-callers test does; the suite now completes in milliseconds.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe test now starts the gated connection asynchronously, waits for dialing to begin, releases the builder gate, and awaits connection completion. ChangesPeer session test synchronization
Estimated code review effort: 2 (Simple) | ~5 minutes Merge Risk: ⚪ Minimal · up to This test-only change removes a deterministic test hang without altering production behavior, so no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 passed)
Full details: Description checkExplanation The description clearly explains what changed, why the deadlock occurred, how the fix works, the test impact, and that runtime code is unchanged. It omits the template headings, checklist, and review-trigger block, but the core required information is present. Full details: Cmux Swift Actor IsolationExplanation PASS. The commit changes one file, Full details: Cmux Swift Blocking RuntimeExplanation PASS. The diff changes only Full details: Cmux Browser Automation Off-MainExplanation PASS: The pull request changes only Full details: Cmux Expensive Synchronous LoadExplanation PASS: The commit changes only Full details: Cmux Cache Substitution CorrectnessExplanation PASS. The commit changes only Full details: Cmux No Hacky SleepsExplanation PASS. The diff changes only the Swift test file Full details: Cmux Algorithmic ComplexityExplanation PASS. The diff changes only Full details: Cmux Swift ConcurrencyExplanation PASS: The commit changes only the Swift test file. It adds a local Full details: Cmux Swift `@Concurrent`Explanation PASS. The diff changes only test coordination in Full details: Cmux Swift Package BoundariesExplanation PASS: The pull request changes only Full details: Cmux Swiftpm LockfilesExplanation PASS. The pull request changes only Full details: Cmux Swift LoggingExplanation PASS: The commit changes only Full details: Cmux User-Facing Error PrivacyExplanation PASS: The diff changes only a Swift test file. It adds asynchronous test coordination and a developer-only comment. It does not add or modify production user-facing errors, alerts, command output, API bodies, or recovery copy. The repository rule explicitly allows tests and developer-only comments. Full details: Cmux Full InternationalizationExplanation PASS: The pull request changes only Full details: Cmux Swiftui State LayoutExplanation PASS — The pull request changes only a Swift Testing file, Full details: Cmux Architecture RethinkExplanation PASS. The diff changes only a Swift test. It replaces an await on a deliberately gated dial with a test Task, a bounded test helper wait, gate release, and Task value await. The architectural rule explicitly allows test-only synchronization. The change introduces no runtime timing path, mutable state owner, duplicate wiring, or UI lifecycle owner. The parent test contained the deadlock, and the neighboring test already uses the same gate-release pattern. Full details: Cmux Swift Auxiliary Window Close ShortcutsExplanation PASS: The pull request changes only Full details: Cmux Source ArtifactsExplanation PASS. The pull request changes one existing Swift test at Full details: Cmux No Test Or Debug Seam In Production SourceExplanation PASS: The only changed file is Full details: Cmux No Ambient Global StateExplanation PASS: The pull request changes only ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
Greptile SummaryThis test-only change fixes a deterministic deadlock in the peer-session diagnostic test.
Confidence Score: 5/5The PR appears safe to merge and fixes the test deadlock without affecting production code. The test now observes that the gated builder has begun its dial before releasing the continuation, and actor serialization prevents release from racing ahead of continuation installation. Important Files Changed
Reviews (1): Last reviewed commit: "test(iroh): release the gated dial that ..." | Re-trigger Greptile |
Un-deadlocks the
swift-package-testsCI job, red onmainsince at least Aug 19 (run 32212616081).CmxConnectivityPeerSessionTests.onePeerTraceUsesOneAliasAndOneEstablishedSessionEventawaitspeer.connectedSession(for:)built on aGatedConnectivitySessionBuilder, and no line ever releases the gate, so the dial parks forever. The per-suite CI runner then hits its 300 s timeout, retries once, times out again, and fails the job on every run of every PR. The fix releases the gate the way the neighboringconcurrentCallersShareOneDialAndOneAdmittedSessiontest does: start the dial in a task, wait until the builder records the call, release, then await the dial. The suite goes from a deterministic 600 s double-timeout to completing in milliseconds (17 tests).Test-only change; no runtime code is touched. Split out of #10739 so a revert of that feature PR cannot un-fix this CI gate.
Revert:
git revert <sha>restores the deadlock and the red gate; nothing else depends on this commit.Dictionary: per-suite runner =
scripts/ci/run-swift-testing-suites.sh, which runs each test suite in its own process with a 300 s timeout and one retry; gate = a test helper continuation that parks a fake dial until the test resumes it.Summary by cubic
Fixes a deadlock in CmxConnectivityPeerSessionTests.onePeerTraceUsesOneAliasAndOneEstablishedSessionEvent that was timing out the
swift-package-testsjob onmain. Previously the test awaited a gated dial without releasing the gate; it now runs the dial in a task, waits for the builder to record the call, releases the gate, then awaits the result, eliminating the hang.Test-only change; no runtime code is modified. Reverting this will reintroduce the red CI gate.
Written for commit 1f05608. Summary will update on new commits.
Summary by CodeRabbit