Repository navigation
test(dashboards): widget boundary timeouts do not say whether WebView2 or the ticket fetch stalled - #2177
Conversation
…2 or the ticket fetch stalled RejectedTicket_NeverRendersBeforeAnAuthorizedReplacement(revoked: True) timed out on CI waiting for Unauthorized with no further detail. Injecting an immediate WebView2 initialization failure reproduces that exact failure: the host reports Failed and tears down, cancelling the ticket fetch, so Unauthorized never arrives. The widget boundary wait now reports every mounted host's status, the test's full state history and document request count, and the recent [Dashboards] log lines; the WebView2 initialization log line now includes the exception type and HRESULT. No assertion or deadline changes. Co-authored-by: Copilot App <[email protected]>
|
🦞👀 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 adds widget state, request counts, recent logs, and WebView2 exception details to native test failure diagnostics. Example: WebView2 initialization throws COMException 0x8007139F during the revoked-ticket test.
Review scores
ProductKind: Maintenance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it provides useful, narrowly scoped diagnostics absent from main, preserves test behavior, and has no actionable findings. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherBoardWidgetWebHost fetches ticketed widget documents and initializes an isolated WebView2; mounted native tests observe its state and HTTP boundary. flowchart LR
A[Native widget test] --> B[BoardWidgetWebHost]
B --> C[Ticketed document fetch]
B --> D[WebView2 initialization]
B --> E[State callbacks and warning log]
E --> F[Timeout diagnostics]
Technical reviewBest possible solution: Retain the focused diagnostics and use a future failure trace to determine whether a product repair is needed. Do we have a high-confidence way to reproduce the issue? Source confirms that main emits a generic boundary timeout; the supplied injected-failure output demonstrates the diagnostic gap, while the original CI flake mechanism remains unconfirmed. Is this the best way to solve the issue? The defect is insufficient timeout context; the invariant is unchanged pass/fail behavior and timing; the smallest complete fix enriches the existing wait helper and initialization warning, as this diff does. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 90653249bd8a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
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 Reviewed November 13, 2026, 1:45 PM ET / 18:45 UTC. |
What Problem This Solves
Fixes: when a native widget boundary test times out, the failure does not say what the widget reached.
DashboardWidgetCellTests.RejectedTicket_NeverRendersBeforeAnAuthorizedReplacement(revoked: True)failed onmainec49620b(job 131969808060) after 38.9 s with only "Native widget HTTP/relay boundary did not settle." The widget log is not part of the CI artifacts, so the cause cannot be determined from that run.This PR makes the next occurrence identify its own cause. It does not claim to prevent the flake. See "Not verified".
User Impact
User impact: none. Test diagnostics, plus richer detail in one existing warning log line.
Why This Change Was Made
The test waits for
Unauthorizedafter a revoked ticket.BoardWidgetWebHost.StartAsyncstarts the HTTP document fetch and then awaits WebView2 initialization. If initialization throws, the host reports a terminalFailed, tears down, and cancels the in-flight fetch.Unauthorizedis then never reported, and the wait times out.Evidence for that path:
States=[Loading, Failed: Widget content needs the Microsoft Edge WebView2 Runtime.]andDocumentRequests0 or 1.BoardWebViewEnvironmentdoes not cache a faulted task).Unauthorizedarrives 60 ms afterLoadingwarm, and 110–150 ms cold under heavy CPU load (6 busy processes, 2-core affinity).Readywait because WebView2's cold start exceeded the 30 s budget. That is a different wait and not CI's failure.Other paths that could drop or delay
Unauthorizedare not excluded: anUnloadedduring mount, or an HTTP or thread-pool stall. The new output distinguishes them.Changes:
WaitForWebHostAsynctimeouts now report each mounted host's status and detail, an optional per-test summary, and the last five[Dashboards]log lines.RejectedTicket_*records its full state history, with details, and the document request count.BoardWidgetWebHostnow logs the exception type and HRESULT when WebView2 initialization fails (previously onlyex.Message), so the next CI failure names the actual error.Evidence
Injected-failure output with this change:
Native widget HTTP/relay boundary did not settle within 00:00:05. Hosts=[Failed: Widget content needs the Microsoft Edge WebView2 Runtime.]; States=[Loading, Failed: Widget content needs the Microsoft Edge WebView2 Runtime.]; DocumentRequests=1; RecentLog=[... [Dashboards] widget WebView2 initialization failed: COMException 0x8007139F: TEMP injected](The injection and the 5 s loader timeout were temporary and are not committed.)
Change Type
Scope
winnodeRequired proof pools
none: test diagnostics plus one log-line detail. CI's UI job runs these tests. No custom pool applies.Validation
Tested on base
3cc72800with the final tree (commit81de322f; the tested tree is identical).mainis nowfbc02870, with no changes to these files.dotnet test tests/OpenClaw.Tray.UITests --no-build --filter "FullyQualifiedName~DashboardWidgetCellTests.RejectedTicket_NeverRendersBeforeAnAuthorizedReplacement": 5 consecutive passes (2/2 each).dotnet test tests/OpenClaw.Tray.UITests --no-build --filter "FullyQualifiedName~DashboardWidgetCellTests": 119 passed, 0 failed (before the log-line change, which does not touch the test path)..\scripts\validate-test-timing-patterns.ps1: passed../build.ps1: all builds succeeded.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj: 6,444 passed, 0 failed.OPENCLAW_TRAY_*roots under the shared desktop lock. The real OpenClawTray profile manifests were unchanged.Real Behavior Proof
81de322f.Yes/No/N/A) N/ASecurity Impact
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain the risk and mitigation:Compatibility and Migration
Yes/No) YesYes/No) NoYes/No) NoReview Conversations