Repository navigation
test(setup): fast-validation fails on main because setup tests look up the companion without waiting - #2153
Conversation
…p the companion without waiting openclaw#2127 added seven null-forgiving SetupCompanion.Find(page)! lookups, which the test-timing ratchet rejects. Acquire the companion inside a bounded named wait (OnboardingNativeProof.CompanionAsync) and use that capture. AssertFixedPageChrome and AssertProgress become async and every call site awaits them. All assertions are unchanged and the ratchet baseline is not raised. 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 replaces seven immediate setup-companion lookups with a shared bounded wait while preserving existing assertions. Example: Fast validation scans NativeSharedFlowTests.cs after the setup redesign.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open: this collaborator-authored PR repairs a verified timing-ratchet failure still present on main; no introduced correctness defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherNative onboarding tests inspect SetupWindow's mounted WinUI pages and sibling companion; the shared test helper waits for that companion before existing layout and progress assertions run. flowchart LR
A[Native onboarding tests] --> B[CompanionAsync]
B --> C[Rendered condition wait]
C --> D[SetupCompanion Find]
D --> E[Mounted visual tree]
B --> F[Existing layout and progress assertions]
Technical reviewBest possible solution: Use the existing rendered-condition wait to capture the companion once available, preserving all setup assertions and the ratchet baseline. Do we have a high-confidence way to reproduce the issue? Main retains the seven immediate lookups named by the failed CI annotations; source and recorded failures establish the ratchet violation without executing target code. Is this the best way to solve the issue? The patch is the smallest complete repair: one reused wait mechanism, one shared capture helper, and awaited callers with unchanged assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 85c8ffa61872. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
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:36 AM ET / 06:36 UTC. |
Related: #2127, #2141
What Problem This Solves
Fixes:
fast-validationandRun Tray Testsfail onmain(run 43373652870), so every open PR fails them too.#2127 merged on a base from before #2141 and added seven null-forgiving
SetupCompanion.Find(page)!lookups. The #2141 test-timing ratchet rejects these (one-shot-uia-lookup: 717 occurrences against a baseline of 710).User Impact
User impact: none. This is a test-only change that unblocks CI for
mainand every open PR.Why This Change Was Made
SetupCompanion.Findwalks the page's visual-tree ancestors and returns null until the page is mounted in the setup composition. A null-forgiving lookup asserts that the companion is there without waiting for it.OnboardingNativeProof.CompanionAsync(page): gets the companion inside a bounded, namedTestSupport.WaitForRenderedConditionAsyncand returns that result. This is the pattern the ratchet asks for.AssertFixedPageChromeandAssertProgressbecameAssertFixedPageChromeAsyncandAssertProgressAsync, and all 14 call sites await them.Evidence
.\scripts\validate-test-timing-patterns.ps1on this branch: "Test timing pattern ratchet passed". It failed onmain85c8ffa6with the same seven lines CI reported.Change Type
Scope
winnodeRequired proof pools
none: test-only change to how existing setup UI tests look up an element. CI's Tray UI jobs run the affected classes. No capacity-dependent custom pool is required.Validation
Tested on base
85c8ffa6with the committed tree (commit6bb4d59e)..\scripts\validate-test-timing-patterns.ps1: passed../build.ps1: all builds succeeded.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj: 6,410 passed, 0 failed.FullyQualifiedName~OnboardingWindowsFlowTests|FullyQualifiedName~NativeSharedFlowTests|FullyQualifiedName~OnboardingAiPageTests.Category=NativeOnboardingProoftests, which CI's Tray UI filters exclude. They require a reviewed-proof setup:OPENCLAW_UI_PROOF_DIRplus a source freeze and manifest SHA. They failed on those preconditions. WithOPENCLAW_UI_PROOF_DIRset, 12 failed only on the freeze precondition.LocalAi_FullWindowShowsHeadingStateGroupsAndFooterfails earlier, atOnboardingAiPageTests.cs:1294. That is a footer-row structure assertion that runs before any companion lookup, so this diff does not affect it. It is a proof-only test that CI does not run, and it was not investigated further.Real Behavior Proof
6bb4d59e.AssertFixedPageChromeAsync,AssertProgressAsyncand the convertedNativeSharedFlowTestssites.Yes/No/N/A) N/ANativeOnboardingProoftests need a reviewed source-freeze setup and are not run in CI.Security 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