Repository navigation
test(macos): await dashboard cancellation loading state - #170248
Conversation
Wait for the existing WebKit loading notification while the fixture response remains blocked. Preserve cancellation, window and pending-navigation checks, reject failure-page completion, and release the response gate and join the opening task on errors. SwiftFormat, focused SwiftLint, diff checks, and isolated Codex review passed. Native compilation and runtime proof remain pending on an isolated macOS runner.
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR waits for WebKit’s stopped-loading notification before asserting dashboard cancellation and improves test cleanup. Example: Cancel a dashboard handoff while the fixture HTTP response remains blocked.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it makes a focused, justified test repair, and source review found no actionable defect. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe macOS integration test drives DashboardManager through a real WebKit document load against a loopback HTTP fixture and checks cancellation teardown. flowchart TD
A[Cancellation test] --> B[DashboardManager]
B --> C[DashboardWindowController]
C --> D[WebKit document load]
E[Blocked HTTP fixture] --> D
D --> F[Loading notification]
F --> G[AsyncTestSignal assertions]
Technical reviewBest possible solution: Retain the notification-based wait and existing cancellation contract, then validate the changed test in disposable macOS CI. Do we have a high-confidence way to reproduce the issue? Source confirms the immediate assertion follows asynchronous WebKit teardown; the body records repeated native failures, but their downloadable job logs were blocked by the network allowlist. Is this the best way to solve the issue? Using the existing signal helper and WebKit notification addresses the missing synchronization without weakening assertions, polling, or increasing deadlines. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ee4ac0556e79. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +17. Total +17 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 12, 2026, 5:33 PM ET / 21:33 UTC (Revision 2). |
) ## What Problem This Solves The Dashboard cancellation test introduced in `30559a4d18d31b87d49e84697df358dbf082752e` (openclaw#169568) assumes that returning from native cancellation means WebKit has already published `isLoading = false`. Native teardown calls `stopLoading()`, but the test does not await that asynchronous state change. The assertion failed in [scheduled CI 38305224828](https://github.com/openclaw/openclaw/actions/runs/38305224828/job/114997825068) and again in validation run 38306200884. ## User Impact The regression test waits for WebKit's actual stopped-loading state while preserving cancellation, window cleanup, and pending-navigation checks. This changes one test file, +27/−10 lines, with no production change, sleep, polling, or increased deadline. ## Why This Change Was Made Observe the existing loading-state notification with `AsyncTestSignal` while the fixture's HTTP response remains blocked. Keep the response gated until loading stops so ordinary completion cannot satisfy the cancellation check, and reject failure-page completion. Invalidate the observation on exit; on errors, cancel and join the opening task and release the response gate. ## Evidence - Native CI [38311910220, job 115019805962](https://github.com/openclaw/openclaw/actions/runs/38311910220/job/115019805962), head `0c4b38b77adfcd32fc25a18f5d0ed7fb97c2faae`: the exact cancellation target passed in 7.770 seconds; `DashboardExperienceTests` passed all six tests (nine cases) in 132.289 seconds. The default native invocation passed all 2,505 tests in 282 suites in 551.058 seconds. These are actual Dashboard target and suite results. - Candidate `1efe4806e7ae5beb46ede6a3c40b48e7356d86da` contains the exact reviewed and tested Dashboard source. Native owners, relevant fixture/wait helpers, Swift package dependencies, test runner, Swift configurations, and CI workflow match the passing composition and audited main `57a1e1ef0cd47249a4fb3e610b2a19b723ae92c9`. Main still has the unchanged test preimage. The composition also contained a separate MLX test repair; its full native pass is not claimed as an exact-candidate full-suite run. - Pinned SwiftFormat and focused SwiftLint passed with zero violations on the same test source and configuration. Whitespace checks, normal commit hooks, and one isolated Codex review passed with no actionable findings. - Exact-candidate [CI 38309523531](https://github.com/openclaw/openclaw/actions/runs/38309523531) completed successfully, but native and static jobs were skipped. Native compilation/runtime and focused Swift static proof are qualified separately above; skipped checks are not claimed as passing. No new local native runtime was run for this qualification.
What Problem This Solves
The Dashboard cancellation test introduced in
ec7fec0636d38748b2205a0a117233441e8b1f2c(#169568) assumes that returning from native cancellation means WebKit has already publishedisLoading = false. Native teardown callsstopLoading(), but the test does not await that asynchronous state change. The assertion failed in scheduled CI 38305224828 and again in validation run 38306200884.User Impact
The regression test waits for WebKit's actual stopped-loading state while preserving cancellation, window cleanup, and pending-navigation checks. This changes one test file, +27/−10 lines, with no production change, sleep, polling, or increased deadline.
Why This Change Was Made
Observe the existing loading-state notification with
AsyncTestSignalwhile the fixture's HTTP response remains blocked. Keep the response gated until loading stops so ordinary completion cannot satisfy the cancellation check, and reject failure-page completion. Invalidate the observation on exit; on errors, cancel and join the opening task and release the response gate.Evidence
0c4b38b77adfcd32fc25a18f5d0ed7fb97c2faae: the exact cancellation target passed in 7.770 seconds;DashboardExperienceTestspassed all six tests (nine cases) in 132.289 seconds. The default native invocation passed all 2,505 tests in 282 suites in 551.058 seconds. These are actual Dashboard target and suite results.1efe4806e7ae5beb46ede6a3c40b48e7356d86dacontains the exact reviewed and tested Dashboard source. Native owners, relevant fixture/wait helpers, Swift package dependencies, test runner, Swift configurations, and CI workflow match the passing composition and audited main012fa012eb6ef3708a6d09a9104b48e784f8327a. Main still has the unchanged test preimage. The composition also contained a separate MLX test repair; its full native pass is not claimed as an exact-candidate full-suite run.