Repository navigation
fix(macos): prevent dashboard fixture loopback timeouts - #139556
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Install the real connection handler before starting the listener and serialize transport state on a fixture-owned queue. Preserve MainActor response hooks and cancel retired client tasks. Keep request timeouts unchanged.
|
Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 9:19 PM ET / September 6, 2026, 01:19 UTC. ClawSweeper reviewWhat this changesMoves the macOS dashboard test server onto a private transport queue and adds a regression checking HTTP responses while the main actor is blocked. Merge readiness✅ Ready for maintainer review The repair remains necessary: current main retains the main-queue dependency. The earlier missing-repair finding is resolved, and no introduced correctness or security defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe dashboard HTTP fixture serves local HTML and optional custom responses to macOS native tests. Its transport scheduling affects test reliability without changing the shipped app. flowchart LR
A[Native test client] --> B[Loopback listener]
B --> C[Private transport queue]
C --> D{Response hooks configured?}
D -->|No| F[HTTP response]
D -->|Yes| E[Main actor hooks]
E --> C
F --> G[Client cleanup]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceOther +59. Total +59 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep fixture transport independent of UI scheduling while preserving main-actor hooks, bounded requests, and deterministic teardown. Do we have a high-confidence way to reproduce the issue? Yes: current main requires main-queue callbacks to serve HTTP, and the regression synchronously blocks that queue during a request. The PR reports a before/after native run; this review established the mechanism from source without executing it. Is this the best way to solve the issue? Yes: moving transport ownership off MainActor addresses the scheduling dependency directly without increasing timeouts or weakening assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8214179fe29c. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
* commit '047587a542ce205ee78354fbd88ba8ec05c07844': (45 commits) chore(ui): refresh control ui locales (#139481) fix(slack): keep prototype-named emoji shortcodes intact (#136374) fix(gateway): deliver upgrade rejection responses under Bun (#139516) refactor(test): simplify catalog guards and fix native report fixture (#139496) fix(macos): prevent dashboard fixture loopback timeouts (#139556) fix(matrix): preserve selected reply targets inside threads (#139479) test(gateway): preserve held-work close failures (#139593) refactor(exec): share package argument scanning (#139560) fix(audit): preserve sequence range validation before numeric decoding (#139587) fix(transcripts): retain capture ownership through failed cleanup (#139572) refactor(models): share selector reference traversal (#139571) perf(agents): classify allowlists without intermediate sets (#138392) chore(release): update appcast for 2026.9.2 (#139575) fix(ci): synchronize cloud retries and board widget input (#139506) fix(plugins): explain SDK incompatibilities after core updates (#139458) fix(voice-call): retain installed WebSocket behavior under Bun (#139567) test(text): consolidate literal sanitizer cases (#139579) test(gateway): observe native drain without a lint exception (#139576) test(memory): consolidate visibility fixtures without policy defaults (#139569) fix(ui): show shimmer skeletons while loading Control UI (#139525) ...
* origin/main: fix(cli): keep note text with Windows and Unicode line endings (#139512) fix(agents): keep isolated completion context on its admitted generation (#139607) fix: avoid declaration builds during source-server updates (#139392) fix(models): keep discovered models after catalog refresh failures (#139357) fix(gateway): record a transcript notice when a run fails before replying (#139439) refactor(ios): reuse shared integer conversion (#139581) fix(sessions): prevent database lock failures during reclamation (#139469) perf(test): reuse transforms within owned scheduler slots (#139553) test(agents): share sparse transcript input fixtures (#139589) chore(ui): refresh control ui locales (#139481) fix(slack): keep prototype-named emoji shortcodes intact (#136374) fix(gateway): deliver upgrade rejection responses under Bun (#139516) refactor(test): simplify catalog guards and fix native report fixture (#139496) fix(macos): prevent dashboard fixture loopback timeouts (#139556) fix(matrix): preserve selected reply targets inside threads (#139479)
* commit 'refs/openclaw/tasks/pr-135167-main': (2467 commits) refactor(ios): reuse shared integer conversion (#139581) fix(sessions): prevent database lock failures during reclamation (#139469) perf(test): reuse transforms within owned scheduler slots (#139553) test(agents): share sparse transcript input fixtures (#139589) chore(ui): refresh control ui locales (#139481) fix(slack): keep prototype-named emoji shortcodes intact (#136374) fix(gateway): deliver upgrade rejection responses under Bun (#139516) refactor(test): simplify catalog guards and fix native report fixture (#139496) fix(macos): prevent dashboard fixture loopback timeouts (#139556) fix(matrix): preserve selected reply targets inside threads (#139479) test(gateway): preserve held-work close failures (#139593) refactor(exec): share package argument scanning (#139560) fix(audit): preserve sequence range validation before numeric decoding (#139587) fix(transcripts): retain capture ownership through failed cleanup (#139572) refactor(models): share selector reference traversal (#139571) perf(agents): classify allowlists without intermediate sets (#138392) chore(release): update appcast for 2026.9.2 (#139575) fix(ci): synchronize cloud retries and board widget input (#139506) fix(plugins): explain SDK incompatibilities after core updates (#139458) fix(voice-call): retain installed WebSocket behavior under Bun (#139567) ...
) * test(macos): reproduce dashboard fixture main-actor timeout * fix(macos): serve dashboard fixtures off the main queue Install the real connection handler before starting the listener and serialize transport state on a fixture-owned queue. Preserve MainActor response hooks and cancel retired client tasks. Keep request timeouts unchanged.
What Problem This Solves
Resolves a problem where
macos-swift (tests)intermittently fails an unrelated PR becauseDashboardHTTPFixtureTeststimes out fetching inert loopback HTML. The reported failure is run 33999463775, macos-swift (tests) on #139522: the first URLSession request fails withNSURLErrorDomain -1001after 2.627 seconds; the suite reports one issue across 2,042 tests.Why This Change Was Made
The fixture already waits for
NWListener.State.ready, starts its two listeners sequentially, uses distinct ephemeral ports, disables URLSession caches, and replies withConnection: close. The transport instead depends on the main queue for accepting connections, reading headers, sending responses, and cleanup. Parallel native tests can occupy that queue, including deliberate semaphore stalls inTalkModeRuntimeSpeechTests. A TCP handshake can complete while the application callbacks remain queued until after the two-second request deadline. The original log does not identify which callback was delayed.The repair gives each fixture a private serial transport queue and installs its real connection handler before starting the listener, as Network.framework requires. Existing main-actor response hooks remain isolated there, with cancellation when their client closes. Startup still waits for
.ready; request deadlines, assertions, connection limits, and header bounds remain unchanged.User Impact
Developers get reliable dashboard fixture HTTP responses even while other native tests occupy the main actor. This is test support only; shipped app behavior does not change.
Evidence
f4ae221bd18b2fee0c1c0ba14d5d444f22f07f07failed only the new regression at its HTTP-success assertion (2,052 tests, one issue). Both existing fixture tests passed. This reproduces the main-queue dependency without relying on random suite scheduling.swift build --package-path apps/macos --build-system native --build-testspassed after generating the standard Apple Mermaid resources; changed-file checks, Swift formatting, native localization verification, and independent review passed.69680abe79042e58d84866ad9b44b9facf26d668passed the completeDashboardHTTPFixtureTestssuite, including the new blocked-main-actor regression. The only issue across 2,053 tests was the unchangedPipeReadStreamTestscleanup join timing out at line 39; it passed in the preceding run and does not use this fixture. The same-head rerun passed, including all 2,053 app tests, the two named-profile tests, 1,655 shared-kit tests, the original fixture tests, the new regression, and the pipe cleanup test. The required CI gate is green. No timeout or assertion changed; the pipe test remains a separate follow-up.