Repository navigation
fix(tests): Dashboards test crashes when the empty board's detail text is read once after a re-render - #2193
Conversation
…t is read once after a re-render DashboardsRenderNativeReportsTabsAndFailureStates waited for the empty board's Open chat action and the re-pinned row, then looked up DashboardEmptyDetail once. On CI the board's UIA elements were republished between those steps, the lookup returned null and the test threw a NullReferenceException, although the board was rendered correctly. The last wait before the assertion and screenshot now requires the selected pinned row, the on-screen action and the detail text together, and reads the text inside that wait. The exact-text assertion is unchanged. 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 captures the empty dashboard detail text inside the final UI Automation readiness wait and tightens the timing-pattern baseline. Example: The Dashboards fixture test opens an empty board after unpinning and re-pinning Dashboards.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this is a focused, maintainer-authored test repair that current main still needs; no introduced correctness or security defect was found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe native UI fixture drives Companion against a synthetic Gateway and reads its UI Automation tree to validate dashboard rendering. flowchart LR
A[Fixture test] --> B[Synthetic Gateway]
B --> C[Companion Dashboards]
C --> D[UI Automation tree]
D --> E[Combined readiness wait]
E --> F[Exact assertion and capture]
Technical reviewBest possible solution: Keep the combined readiness wait and captured detail value in the existing fixture test, preserving every assertion and the tighter baseline. Do we have a high-confidence way to reproduce the issue? Current main visibly dereferences a nullable detail lookup after unrelated waits, but the reported rare UI Automation gap has no deterministic reproduction and was not reproduced during this review. Is this the best way to solve the issue? This is the smallest complete repair: reuse the existing readiness helper, capture the observed value, preserve the independent expected text, and lower the ratchet. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6d968b68a6d7. Provenance checked
TestingProof path: none. 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. 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, 5:06 PM ET / 22:06 UTC. |
GatewayFixtureNativeDashboardsUiTests.cs produced repeated CI flakes from one-shot FindById(...)! reads after a re-render or resize (openclaw#2171, openclaw#2193). Sweep the remaining 30 into bounded waits: invocations wait until the control is present and enabled and invoke once, reads wait for presence and keep the polled element, and lambdas inside waits treat a missing peer as not ready. A local run also showed DashboardsBackdropSpansGalleryAndBoardInBothThemes failing with "Named backdrop host is missing": its stability wait polled a helper that threw when the host peer was briefly absent during the minimum-width resize. The backdrop and responsive stability waits now treat a missing host as not ready, restart their stability window, and return the settled width so callers do not re-read it once. The one-shot lookup baseline entry for this file drops from 30 to 0. Co-authored-by: Copilot App <[email protected]>
…ion element is briefly missing after a re-render or resize (#2222) * test(dashboards): wait for UIA peers instead of one-shot reads GatewayFixtureNativeDashboardsUiTests.cs produced repeated CI flakes from one-shot FindById(...)! reads after a re-render or resize (#2171, #2193). Sweep the remaining 30 into bounded waits: invocations wait until the control is present and enabled and invoke once, reads wait for presence and keep the polled element, and lambdas inside waits treat a missing peer as not ready. A local run also showed DashboardsBackdropSpansGalleryAndBoardInBothThemes failing with "Named backdrop host is missing": its stability wait polled a helper that threw when the host peer was briefly absent during the minimum-width resize. The backdrop and responsive stability waits now treat a missing host as not ready, restart their stability window, and return the settled width so callers do not re-read it once. The one-shot lookup baseline entry for this file drops from 30 to 0. Co-authored-by: Copilot App <[email protected]> * test(dashboards): give the widget pixel wait a named budget and report widget state The new-test soak's CPU-contention run failed DashboardsRenderNativeReportsTabsAndFailureStates with "Timed out waiting for visible dashboard pixels: 99.97, Uptime". The failure frame shows the HTML Service health widget still in the product's Slow state ("This widget is taking longer than usual to load") 30.1 s after board.get. On CI, boards normally render in 1.8-6.6 s (12 samples, 4 runs). Replace the literal 30 s with DashboardPixelsTimeout (default 60 s, override OPENCLAW_GATEWAY_FIXTURE_DASHBOARD_PIXELS_TIMEOUT_SECONDS, capped at 90 s): one product frame retry after its 30 s load deadline plus a normal render, inside the 150 s test body budget. On timeout, the message now names each widget's Loading, Slow, Error or NeedsApproval state, so a slow load stays distinguishable from a failed one. The diagnostic never replaces the timeout. Co-authored-by: Copilot App <[email protected]> --------- Co-authored-by: Copilot App <[email protected]>
Related: #2171 (fix: pinned pages can crash Companion after Settings refreshes its agent list)
What Problem This Solves
Fixes:
GatewayFixtureUiTests.DashboardsRenderNativeReportsTabsAndFailureStatesintermittently fails withNullReferenceExceptionatGatewayFixtureNativeDashboardsUiTests.cs:1353. Latest occurrence: #2181 run 43494207420, job 132123027028 (Mock Gateway fixture UI shard B, Dark theme, 34 s in). #2181 itself only changedDesktopCompanionWindowTests.cs.User Impact
User impact: there is no product change. Contributors stop seeing a false Mock Gateway fixture failure.
Why This Change Was Made
Line 1353 is
Assert.Equal("No content was supplied …", FindById(run, "DashboardEmptyDetail")!.Current.Name).The test opens the empty session dashboard and waits until its Open chat action is on screen. It then waits until the re-pinned Dashboards sidebar row is selected, and only after that looks up the detail text once.
On CI that single lookup returned null, but the app was fine:
board.getfor the empty session, so the board did not reload.VStack(DashboardsStates.Status).So the detail's UI Automation element was briefly unavailable between the test's waits while the sidebar row was being re-added, and the one-shot lookup caught that moment. This is the same one-shot-lookup class #2171 fixed at line 1343 of this test.
The last wait before the assertion and screenshot now requires all three together:
The exact-text assertion is unchanged and runs right after the wait, followed by the screenshot, so it still checks the state that is captured. The repository timing baseline for this file drops from 31 to 30 one-shot UIA lookups. The change adds no retries of assertions, sleeps, fixed settle counts, skips or weaker assertions.
Evidence
5c85f0a3is fix(tests): desktop lobster scale and reconcile tests read the mascot mood before it renders #2181 onmainbf61595e, where line 1353 is the one-shot lookup.board.getfor the empty session.Change Type
Scope
winnodeRequired proof pools
none: test-only change to a Mock Gateway fixture UI test that CI runs directly.Validation
All runs were local on Windows x64 at 175% DPI, with isolated profiles. Metadata for the real
%APPDATA%/%LOCALAPPDATA%\OpenClawTraywas unchanged after every run.DashboardsRenderNativeReportsTabsAndFailureStates(Light and Dark) on the final source.\scripts\validate-test-timing-patterns.ps1: passed (baseline 31 to 30 for this file)../build.ps1: all builds succeeded.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj: 5864 passed, 0 failed, 29 skipped.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj: 6501 passed, 0 failed.main1af3ced2d. Upstream did not change the test file, only other baseline entries. The guard passed after the rebase.Real Behavior Proof
dotnet test tests/OpenClaw.Tray.UITests -c Debug -r win-x64 -p:DevBuild=false --no-build --filter "FullyQualifiedName~DashboardsRenderNativeReportsTabsAndFailureStates"withOPENCLAW_RUN_GATEWAY_FIXTURE_UI=1.Yes/No/N/A): N/A (local artifacts only).GalleryHeaderMatches()checks at about lines 1327 and 1341, pinned-row and customize lookups at about 1239 and 1252-1254, the copy-menu item at about 1313, and the pin toggle state at about 1333-1335.Security Impact
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain the risk and mitigation: N/ACompatibility and Migration
Yes/No): YesYes/No): NoYes/No): NoReview Conversations