Repository navigation
test: stabilize flaky UI-job and SetupEngine CI failures - #1981
Conversation
|
🦞👀 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 stabilizes Windows test synchronization, initializes testhost DPI earlier, adjusts test timeout budgets, and documents unresolved CI failures. Example: An off-screen WinUI control becomes ready without another composition frame.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open for landing: all three prior findings are addressed, exact-head CI passes, and no actionable introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Windows test infrastructure drives mounted WinUI controls, launched Companion instances, loopback Gateway fixtures, and PowerShell cleanup harnesses, producing assertions and CI results. flowchart LR
A[Windows CI] --> B[Testhost initialization]
B --> C[WinUI fixture]
C --> D[Mounted controls]
A --> E[Companion application tests]
E --> F[Loopback Gateway fixture]
A --> G[PowerShell cleanup harness]
D --> H[Test results]
F --> H
G --> H
Technical reviewBest possible solution: Land the focused test-infrastructure repairs while retaining strict assertions and tracking the documented product failures separately. Do we have a high-confidence way to reproduce the issue? Source inspection supports the reported timing mechanisms, but intermittent failures were not reproduced during this read-only review. Is this the best way to solve the issue? The patch uses existing fixture and helper owners to wait for observable conditions, preserves negative request assertions and clipping coverage, and avoids production changes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 12789b405719. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
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 HistoryReview history (1 earlier review cycle)
Reviewed November 3, 2026, 6:52 PM ET / 23:52 UTC (Revision 2). |
ee10fef to
d111b1e
Compare
- Serialize the UITests assembly and lock the testhost PerMonitorV2 DPI context at assembly load so launched-app collections cannot poison it before the UIThreadFixture initializes (mode A). - Re-issue the chat timeline end-scroll while waiting for message 240 instead of one scroll followed by a passive 20 s wait (mode B). - Poll the retained composer draft instead of asserting it once, tolerate the handoff receipt temp-file/move race, and raise the handoff settle budget to 45 s (modes C, C2). - Re-check WaitForRenderedConditionAsync on a dispatcher timer so off-screen windows and dynamically inserted children settle, accept XamlRoot as in-tree for the wizard More button, wait for Gateway request quiescence before request-count asserts, bound SVG decode with the real queue-wait-plus-decode product bound, and invoke SettingsBack only when it is enabled (modes D, G1-G4). - Close composer flyouts by awaiting real closure, close stray popups before Reactor teardown, and mark teardown phases in the console (modes E, F1); bracket the dispose finalizer drain (mode F2). - Raise the GatewayPackageCleanup worker timeout to 120 s (mode H). - Record proven unresolved modes in docs/CI_FAILURES.md.
d111b1e to
a4bcf4a
Compare
…citations The static ScrollToAsync refactor kept the old instance-method logging block, so GatewayFixtureUiTests did not compile (CS0103 scroll/before, CS9105 output in static context) and the UI job failed all three steps. Restore main's ScrollToAsync verbatim, with its scroll diagnostics, and the one end-scroll followed by passive visibility polling in the resize test, so the clipping regression from openclaw#1549 stays covered. Also correct two CI_FAILURES.md review findings: run 41532119336 is a fork run about hosted fixture startup, not the local pristine reasoning-picker crash, and the 90 s fail-fast wait, phase-bearing message, and bootstrap/window-creation markers are existing fixture diagnostics, not new in this change.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
- Keep IsLoaded as the wizard More-button readiness check. The poll timer already covers the no-frame case, and a bare XamlRoot check let the automation peer invoke a button a user could not yet click. - Restore the single-decode SVG bound to SvgRenderTimeout + 2 s. The single-load tests arrange no queue contention, so the doubled queue-plus-decode budget only hid a real overshoot: the decode cap fires on time but SvgImageSource.SetSourceAsync blocks the UI thread past it. Assert the decode slots are idle before timing and include timestamped resolver warnings in the failure message. - Add Load_QueuedBehindBusyDecodeSlots_CompletesOnceASlotFrees to cover queue wait plus decode deterministically. - Record the UI-thread blocking attribution in docs/CI_FAILURES.md.
What Problem This Solves
Fixes: intermittent
Build and TestCI failures in the Tray UI and SetupEngine suites when runner load or window-creation timing races make assertions and waits fail spuriously.User Impact
User impact: no user-visible product change; CI runs on
mainstop failing on timing-sensitive UI-job and SetupEngine flake modes, so real regressions become visible instead of drowning in retries.Why This Change Was Made
The flake modes share a small set of causes: a testhost PerMonitorV2 DPI context that launched-app collections can poison before
UIThreadFixtureinitializes, single-shot asserts on transient re-renders, and unbounded native operations that a busy hosted runner cannot finish in the old budget. The change serializes the UI test assembly, polls transient state instead of asserting it once, waits for Gateway request quiescence before request-count asserts, and raises two genuinely insufficient timeouts (handoff settle 45 s, GatewayPackageCleanup worker 120 s). The SVG decode bound stays atSvgRenderTimeout + 2 s.A2UISvgTests.PathologicalGeometry_BoundedByRenderTimeoutflakes becauseSvgImageSource.SetSourceAsyncsometimes blocks the UI thread past the 8 s cap (the cap fires on time, the load returns about 6 s late). That is a product defect, so the test stays strict and the finding is recorded indocs/CI_FAILURES.md. A new test,Load_QueuedBehindBusyDecodeSlots_CompletesOnceASlotFrees, covers queue wait plus decode. No retries, masking, or weakened assertions were added; strict waits were replaced by bounded condition polling. Timeline-scroll coverage keeps main's exact single end-scroll followed by passive visibility polling, so the #1549 clipping regression stays covered.docs/CI_FAILURES.mdrecords the proven-unresolved modes, including the hosted-runner fixture window-creation hang and the wizard__morebutton race, which remain open product investigations.Evidence
docs/CI_FAILURES.mdupdated: fixed modes removed from the backlog, remaining modes attributed with run links and next steps.0314a946: theUI, functional, and accessibility testsjob aborted when the Tray UI testhost crashed duringReactorChatLayoutProofTests.ReasoningPicker_PreservesCurrentValueWithoutInventingSupportedOptions(last markerchat-proof: body start, no teardown; 241 UI tests had passed). That is the open ReasoningPicker testhost-crash mode indocs/CI_FAILURES.md, also seen onmain(run 41716238427), and it is unrelated to the files changed in0314a946. The earlier head32653620was green in run 41721151363; an even earlier revision left a static-method logging block inGatewayFixtureUiTeststhat broke the UI job's compile, which32653620repaired.PathologicalGeometry_BoundedByRenderTimeoutcan still fail on hosted runners for the product reason above, as it already does onmain(run 41737007496).Change Type
Scope
winnodeRequired proof pools
none: test-infrastructure and docs change only; no product behavior, installer, node, or native runtime contract is touched, so no capacity-dependent custom Windows proof applies.Validation
./build.ps1: pass.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: pass.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: pass.GatewayPackageCleanupTestson this ARM64 workstation; previously flaky local modes pass consistently.Real Behavior Proof
0314a946(review fixes: strictIsLoadedfor the wizard More button,SvgRenderTimeout + 2 ssingle-decode bound, new queued-load test, SVG attribution indocs/CI_FAILURES.md)../build.ps1passes; Shared 4810 passed (24 skipped); Tray 4788 passed;A2UISvgTests15/15 andNativeFallback_GatewayMoreRejectsAnOverlappingContinuepass locally (PathologicalGeometryalone passes at about 8 s)../build.ps1;dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj(4810 passed, 24 skipped);dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj(4788 passed);dotnet build tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -p:Platform=x64(0 errors); hostedBuild and Testrun 41721151363 was green on the earlier head32653620; run 41803498631 on0314a946hit the documented ReasoningPicker testhost crash (see Evidence).0314a946before the unrelated testhost crash.docs/CI_FAILURES.md. For the SVG one, a throwaway UI-dispatcher heartbeat attributes to the UI thread being blocked past the cap:SVG decode timed outlogged at 8.07 s, a dispatcher callback queued at 0.1 s serviced only at about 14 s, reproduced in 3 of 5 local runs. Unresolved modes are documented indocs/CI_FAILURES.md.Yes/No/N/A): N/A (no UI change).__morerace, the ReasoningPicker testhost crash, and the SVGSetSourceAsyncUI-thread blocking remain open product investigations (seedocs/CI_FAILURES.md).Security Impact
No)No)Yes) UI tests now wait for Gateway fixture request quiescence and bind test listeners to loopback within the existing fixture; no new endpoints, protocols, or data scopes.No)No)Yes, explain the risk and mitigation: no new network surface; waits observe the existing loopback fixture only.Compatibility and Migration
Yes)No)No)Review Conversations