Repository navigation
fix(tests): Systems hero proof reads the issues icon before its button hosts it - #2321
Conversation
…n hosts it Hero_StateMatrixRetainsFocusAndGeometryAcrossMountedWidths waited only for the page and content column widths before reading each summary tile's icon well once. The first width does not resize, so the wait can return before any layout pass, while the issues tile's Button presenter does not yet host its content. The content itself was never replaced. Also wait for both icon wells to be in the visual tree, loaded and laid out, with diagnostics. Test-only. 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 changesThe Systems hero UI test waits for both summary icons to load and receive layout before checking their geometry. Example: The test starts at its already-mounted width of 1100 pixels while the Issues button presenter still has no visual children.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR is a focused, useful test-readiness repair that is absent from current main. No actionable defects were found; maintainer authorship also prevents automatic closure. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe native UI test mounts SystemsPageView with synthetic inventory, resizes its WinUI surface, and checks retained controls, focus, scrolling, and layout. flowchart LR
A[Synthetic inventory] --> B[Systems controller]
B --> C[Mounted Systems page]
C --> D[Bounded rendering wait]
D --> E[Identity and geometry assertions]
Technical reviewBest possible solution: Retain this bounded icon-readiness check in the existing UI proof while preserving all subsequent rendering assertions. Do we have a high-confidence way to reproduce the issue? Source confirms that the initial 1100-pixel width check can already be satisfied before the nested icon is ready; the author reports matching native reproductions, but this read-only review ran no tests. Is this the best way to solve the issue? The smallest complete fix extends the existing bounded rendering wait to the controls immediately inspected; it neither repairs product state nor suppresses a permanently missing icon. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 558960df22b2. 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 18, 2026, 4:35 PM ET / 21:35 UTC. |
Related: main 1af2586, run 44195618442 (job 134436348813), first occurrence of this failure.
What Problem This Solves
Fixes: the UI test job intermittently fails
SystemsPageProofTests.Hero_StateMatrixRetainsFocusAndGeometryAcrossMountedWidthswithAssert.Single() Failure: The collection did not contain any matching itemswhen the test reads a summary tile's icon right after the Systems page loads.User Impact
User impact: no user-visible change. CI stops failing this proof on loaded runners; the product behavior it asserts is unchanged.
Why This Change Was Made
Each width step waited only for the page and content column widths, then looked up each summary tile's icon well once. The first width (1100) is the page's mounted width, so that wait can return before any layout pass. At that point the issues tile, a
Button, can still have an empty templateContentPresenter: its content, including the icon well, is not in the visual tree yet.Diagnostics captured at the failing read (4 local reproductions):
Buttonand itsContentPresenterwere loaded and laid out (512x34), but the presenter had no children.Button.Contentwas the sameStackPanelinstance as at test setup, and a content-change callback never fired. Reactor did not remount or replace anything.The per-width wait now also requires both summary icon wells to be in the visual tree, loaded and laid out, with diagnostics on timeout. The existing identity, size and geometry assertions are unchanged. Test-only.
Evidence
SystemsPageProofTestsruns, with the exact CI signature.Hero_StateMatrix*20/20 idle and the whole class 10/10 under CPU burn on the pre-rebase head, plus 10/10 and 3/3 on the rebased head.Change Type
Scope
winnodeRequired proof pools
none: test-only readiness wait in an existing native UI proof; this PR's UI test job runs it.Validation
./build.ps1: passed.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj: 5,910 passed, 29 skipped, 0 failed.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj: 6,755 passed, 0 failed..\scripts\validate-test-timing-patterns.ps1: passed.dotnet test tests/OpenClaw.Tray.UITests --filter FullyQualifiedName~SystemsPageProofTests.Hero_StateMatrixRetainsFocusAndGeometryAcrossMountedWidths: 10/10 runs (8 cases each); wholeSystemsPageProofTestsclass under CPU burn: 3/3. Pre-rebase head: 20/20 and 10/10 under burn.Real Behavior Proof
a912363c.dotnet test tests/OpenClaw.Tray.UITests --filter FullyQualifiedName~SystemsPageProofTests(whole class, under CPU burn) and theHero_StateMatrix*filter; temporary diagnostics (not committed) dumped the issues tile's visual tree and trackedButton.Contentchanges.Renderingcallback because layout runs after it; 13 diagnostic runs with per-frame tracking after a miss did not reproduce naturally. The added wait would time out, not pass, if the icon never rendered.Security Impact
Yes, explain the risk and mitigation:Compatibility and Migration
Review Conversations
Hanselman review
Dual-model review (Claude Opus 5.5 high, GPT-6 Astra long_context high) on base
a912363c: no CRITICAL/HIGH findings; both confirmed the wait cannot pass vacuously and does not repair state. Applied: rebase onto current main (Opus, process), comment reworded to the observed cause (Opus LOW/MEDIUM),IsLoadedadded to the timeout diagnostics (Opus LOW). Noted, no change: the wait and the following assertions are not atomic (both models); this is safe here because layout does not remove presenter content.