Skip to content

fix(ci): Tray UI tests fail intermittently and the step times out on passing runs - #2130

Merged
bkudiess merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-tray-ui-job-flakes
Nov 13, 2026
Merged

bkudiess merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-tray-ui-job-flakes

Conversation

@bkudiess

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: the "UI, functional, and accessibility tests" CI job fails intermittently in the Tray UI and accessibility tests, and the "Run Tray UI Tests" step is killed by its 15-minute limit on runs where every test passed.

User Impact

User impact: no user-visible change. Contributors should see fewer reruns on main and on PRs. One product change applies only when the test-only OPENCLAW_ACCESSIBILITY_NAVIGATION_SIGNAL variable is set.

Why This Change Was Made

Each failure was traced from CI logs to a cause. Where possible, the fix was proven with a deterministic local reproduction. Tests now wait for the state they assert, with existing bounded waits. The changes add no retries, no sleeps, no fixed settle counts and no skips, and they keep every assertion.

Failure (CI signature) Cause Fix
DashboardWidgetCellTests.HeroResizing… / ResponsivePage…(520): Assert.InRange, Actual 196 / 40 Width reaches the column through a posted re-render. The readiness check was also true for the stale render: 196 = 820−64−560 and 40 = |480−40−480|. HeroMatchesColumn requires the column to be rendered for the target width. This also covers 3 passing tests that use the same check.
DashboardWidgetCellTests.ConnectionChange…(completed: False): "relay boundary did not settle" after 30 s WebView2 widgets share one profile. Chromium serializes identical-URL loads behind its HTTP cache lock, so the second sandbox request arrived after exactly 20.0 s. The second fixture widget gets a distinct sandbox query.
DashboardWidgetCellTests.ActiveSearch…(switchAgent: True): Assert.True on search size An agent switch replaces the gallery body, including the search box, through the loading skeleton. Wait until the replacement is laid out.
AccessibilityScanTests (About): BoundingRectangleSizeReasonable on a caption WorkspaceWindow.RenderSettings wrote the page-ready signal right after Frame.Navigate, before the page loaded. SettingsShellView is now the only writer. It publishes after Loaded, then waits for expand storyboards to stop, bounded by OPENCLAW_ACCESSIBILITY_READY_SETTLE_MS (default 5 s). On timeout it publishes nothing, so the test fails cleanly.
NativeSharedFlowTests.NativeInstall… (main 0bd9348) and MinimumWindow… (local suite run): TimeoutException in NextCompositionAsync A two-frame wait used an unnamed 2 s limit. Uses the suite's named render-wait budget (OPENCLAW_UI_RENDER_WAIT_TIMEOUT_SECONDS) and logs slow or missing frames. The theme-surface helper no longer waits for frames it does not need.
SystemsPageProofTests.InventoryRows…(expanded: True): "Expanded contents stay inside their own bordered row." Geometry was checked while the Expander's ExpandStates storyboard could still be running. Also wait for that storyboard to stop, and find the rows again on each check.
WorkspaceWindowProofTests.NativePagesAndOwnerLinks…: missing WorkspaceNavigation, WorkspaceForward; Inbox empty-state timeout One-shot UI Automation lookups during transitions. WorkspaceNavigation was already fixed by #2117 (improve(chat): refine composer sizing and context controls). Inbox flyout state and Forward enabled state now use bounded waits.
ReactorQuestionProofTests.ProductionRoot…: composer Visible, expected Collapsed The question panel and the root subscribe to the coordinator separately. Wait for the composer to collapse, and to become visible again.
ReactorQuestionProofTests.ProductionRoot…: draft "" after a fixed 5-cycle settle Root cause not proven. See Evidence. Wait for the view model to accept the draft, keep all assertions, and record editor and view-model lifecycle events in the failure message.
"Run Tray UI Tests" killed at 15:00 (#2117 finished all 1,382 tests, then was cancelled 0.8 s later) Organic growth: summed test time rose from 570 s to 780 s, mostly ~130 new tests plus ~15% slower app-launch tests. No single test regressed. Raise timeout-minutes to 25. The per-test 300 s hang guard is unchanged.

SettingsChrome_SearchAndBidirectionalHistory…: both CI signatures (SearchBox()! NRE and the raw SettingsSearch lookup) are already fixed on main (#2125 (fix: Dashboard loses the selected chat on newer Gateways) and the retained-observation helper). This PR does not change that test. Cron CronPageMarker failures were a branch-only bug, fixed in the #1893 squash. ForgetConfirmation… was fixed by #2115.

Evidence

  • Deterministic reproductions with temporary toggles, removed before commit:
    • HeroResizing: with the old readiness check and a delayed Post, the test fails with exactly CI's Actual: 196. With the new check it passes.
    • ConnectionChange:
      • With the shared URL, the second sandbox request arrived 20.0 s after the first, and the case took 27.7 s of its 30 s budget.
      • With distinct URLs it took 7.8 s.
  • Repetition: every changed test passed 5 consecutive rounds of 168 tests, covering the whole WorkspaceWindowProofTests and DashboardWidgetCellTests classes, all AccessibilityScanTests, plus the focused tests. NativeSharedFlowTests passed 5 consecutive rounds of 28 tests on the final head.
  • Full Tray UI suite with the CI filter on the final head: 1,369 passed, 9 skipped, 4 failed in 17 m 15 s. All 4 failures are SessionsHubRegressionTests.ResponsiveLayout….
    • Search height was 32.667 against an allowed 31.5–32.5. The host display had switched to 175% scale.
    • The test fails the same way on clean main 3d5f142, so this PR did not cause it. CI pins its desktop.
    • The previous full run, one commit-equivalent earlier, had only the MinimumWindow failure that this head fixes.
  • Accessibility gate: in the test-signal app log it deferred 2–3 polls for the Sessions and Settings pages. A deferral for About was not observed locally.
  • Question draft investigation (the cause is not proven): these mechanisms were ruled out:
    • A Reactor re-render landing between the Text write and the deferred TextChanged does not overwrite the edit. A minimal controlled TextBox experiment showed this.
    • The pooled TextBox had no stale echo-suppression token in 30 traced runs.
    • The only draft-clearing path is the post-send ClearDraftIfUnchanged.
    • 50 stressed runs (2 cores with 2 CPU burners, and in CI order after ReactorToolActivityProofTests) all passed.
    • The new failure message records lifecycle events, so a recurrence will identify the mechanism.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • none: there is no visible product change. The only product change is the test-only accessibility readiness signal, which this PR's native test runs exercise directly. CI's UI job is the authoritative proof.

Validation

All commands ran in the task worktree.

  • Build and core tests (source with diff hash f33f6c4a, identical to the final head for every non-UI-test file):
    • ./build.ps1: all builds succeeded.
    • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 5,847 passed, 29 skipped, 0 failed.
    • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 6,347 passed, 0 failed.
  • pwsh scripts/test-ci-workflow-contract.ps1: passed.
  • dotnet build tests/OpenClaw.Tray.UITests -c Debug -r win-x64: 0 errors.
  • Targeted native tests: dotnet test tests/OpenClaw.Tray.UITests --no-build --filter "<changed tests>", 5 consecutive rounds of 168 passed, 0 failed (diff hash f33f6c4a).
  • dotnet test tests/OpenClaw.Tray.UITests --no-build --filter "FullyQualifiedName~NativeSharedFlowTests": 5 consecutive rounds of 28 passed, 0 failed (final head).
  • Full suite: dotnet test tests/OpenClaw.Tray.UITests --no-build --filter "Category!=Accessibility&Category!=NativeOnboardingProof&Category!=GatewayFixture&Category!=ProductionResources&Category!=AnimationPreferenceEnabled&Category!=AnimationPreferenceDisabled" with OPENCLAW_UI_TEST_RESOURCE_PROFILE=Standard, on the final head: 1,369 passed, 9 skipped, 4 failed. All 4 are the host-DPI SessionsHub case, which fails the same way on main.
  • Isolation: native runs used isolated OPENCLAW_TRAY_DATA_DIR, OPENCLAW_TRAY_APPDATA_DIR and OPENCLAW_TRAY_LOCALAPPDATA_DIR folders. The real %APPDATA% and %LOCALAPPDATA%\OpenClawTray metadata manifests were unchanged after every run.
  • Review: Hanselman dual-model review (Claude Opus 5.5 and GPT-6 Astra, high reasoning) over three rounds.
    • HIGH consensus: the readiness signal could bypass the new gate, and the gate could publish before Loaded. Both are fixed and confirmed resolved by both reviewers.
    • Also fixed: stale publish after deactivation, a timer held only by WinRT, missing diagnostics, an unguarded UI Automation call while polling, and silent slow frames.
    • Remaining notes, not fixed here: about 50 other NextCompositionAsync callers now share the named budget, and the production Gateway's sandbox URL shape was not verified.

Real Behavior Proof

  • Environment tested: Windows 11 dev box, native WinUI desktop (in-process UI test host and isolated app processes), Debug win-x64, held under the shared native-desktop lock.
  • PR head or commit tested: cc2982831 (diff hash 09f43454 equals the validated working tree on base 3d5f1427)
  • Exact steps or command run: the commands in Validation. The demonstrations used temporary environment toggles that are not in the commit.
  • Evidence after fix: HeroResizing with a delayed render: old check failed with Actual: 196, new check passed. ConnectionChange: second sandbox request 20.0 s late with the shared URL, total 7.8 s with distinct URLs. 5 consecutive passing rounds for every changed test.
  • Observed result: all changed tests pass repeatedly. The only full-suite failure is an existing host-DPI case that also fails on main.
  • Screenshot or artifact links verified? (Yes/No/N/A) N/A
  • Not verified or blocked:
    • The ReactorQuestionProofTests draft-loss mechanism was not reproduced or proven.
    • The About accessibility deferral was not observed locally.
    • The exact frame-stall mechanism behind the NextCompositionAsync timeouts is not proven.
    • The CI first-attempt result is pending.

Security Impact

  • New permissions or capabilities? (Yes/No) No
  • Secrets or tokens handling changed? (Yes/No) No
  • New or changed network calls? (Yes/No) No
  • Command or tool execution surface changed? (Yes/No) No
  • Data access scope changed? (Yes/No) No
  • If any answer is Yes, explain the risk and mitigation:

Compatibility and Migration

  • Backward compatible? (Yes/No) Yes
  • Config or environment changes? (Yes/No) Yes. There is a new optional test-only OPENCLAW_ACCESSIBILITY_READY_SETTLE_MS, and the CI step timeout is now 25 minutes.
  • Migration needed? (Yes/No) No
  • If yes, list the exact upgrade steps:

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

This PR replaces timing-sensitive UI test observations with bounded state checks, delays test-only accessibility readiness, and raises the CI step timeout.

Example: Dashboard resizing posts a delayed render for an 820-DIP viewport.

  • Before: The readiness check accepts stale geometry and the assertion reports a 196-DIP discrepancy.
  • After: The test waits for geometry matching the requested viewport before asserting layout.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, useful repair with preserved assertions and substantial reported native validation; confidence remains limited by the pending UI lane and explicitly unresolved failure mechanisms.
Proof confidence 🦐 gold shrimp (3/6) This CI/test repair changes no ordinary user-visible behavior; reported native runs exercise the test-only readiness path, and the authoritative UI CI result remains pending.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Contributors encounter intermittent UI CI failures and cancellation of otherwise passing suites.
Reason: The maintainer-authored direction addresses concrete CI failures with existing test owners and limits its application change to an explicitly enabled test signal.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR contains useful CI reliability fixes that remain absent from main; no actionable introduced defect was found.

Priority: P2
Reviewed head: cc298283177d391913174adb8979e44fddecc036

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Windows UI CI lane runs mounted WinUI tests and real-process accessibility scans; app-owned readiness signals and bounded test observations determine when assertions begin.

flowchart TD
  A[GitHub Actions UI lane] --> B[Native UI tests]
  B --> C[Mounted WinUI controls]
  A --> D[Accessibility fixture]
  D --> E[SettingsShellView]
  E --> F[Loaded and idle transitions]
  F --> G[Readiness acknowledgement]
  G --> D
Loading

Technical review

Best possible solution:

Keep readiness in SettingsShellView and use bounded observations in the existing tests while retaining behavioral assertions and the per-test hang guard.

Do we have a high-confidence way to reproduce the issue?

Source confirms premature Settings acknowledgement and stale-layout acceptance; the body supplies targeted before/after reproductions, while this read-only review executed no builds or tests.

Is this the best way to solve the issue?

The patch uses existing owners and bounded waits for the asserted state, preserves assertions, and documents uncertainty instead of claiming the draft-loss mechanism is solved.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 96f3b25fed85.

Provenance checked

  • Accessibility acknowledgement keeps the original intent (588df90: Fresh page-specific acknowledgement prevents stale navigation observations before accessibility scanning.)
  • Workspace Settings acknowledgement changes intended behavior with a stated reason (4e31031: The same-window Settings refactor retained accessibility signalling; this PR explains why its synchronous publication precedes actual readiness.)
  • Rendered-state waits keeps the original intent (b6c849e: Bounded condition polling replaced transient one-shot observations while preserving product assertions.)
  • Composition wait and CI ceiling changes intended behavior with a stated reason (3eed1f1; dba8121: Native onboarding proof introduced frame waits and a bounded UI CI step; the PR explains their replacement budgets using observed failures and suite growth.)
  • Dashboard, Systems, and question test observations keeps the original intent (e59374c; f059221; 814e732: These suites protect mounted layout, widget connection lifetime, and composer retention; changed observations retain those outcomes.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduction reviewed: The introduced diff changes existing tests, workflow limits, and the opt-in accessibility signal; it adds no dependency, permission, or persisted-data changes. (cc298283177d)
  • Single Settings readiness owner: SettingsShellView checks Loaded state and expand storyboards before publishing, rejects obsolete content, and bounds polling; Workspace's premature Settings acknowledgement is removed. (src/OpenClaw.Tray.WinUI/Controls/SettingsShellView.xaml.cs:886, cc298283177d)
  • Existing acknowledgement contract preserved: Stabilize accessibility navigation readiness #1228 established fresh page-specific acknowledgements followed by an independent UIA marker check; the current fixture retains both checks. (tests/OpenClaw.Tray.UITests/AccessibilityAppFixture.cs:151, cc298283177d)
  • Full contribution evidence inspected: The complete body reports deterministic stale-layout and shared-URL reproductions, repeated targeted native passes, required build/core-test passes, and four full-suite DPI failures also observed on the base; it explicitly leaves the draft-loss cause unproven. Captured body identity: 02b269d1c01b2e87f05b67952ace63105cbfd74bebed8b1645fc8e206d281000. (cc298283177d)
  • Fixes remain distinct from main: Fetched main retains the original signal publication, test predicates, and 15-minute step limit; its intervening setup repair does not implement this PR. (96f3b25fed85)
  • Current validation state: Core/CLI, Tray/setup/integration, workflow validation, and several packaging checks passed; the UI/accessibility check and other checks remained in progress, with no failed check returned. (.github/workflows/ci.yml:787, cc298283177d)

Likely related people:

  • Scott Hanselman: Raw commit 588df90 adds src/OpenClaw.Tray.WinUI/Services/AccessibilityNavigationSignal.cs:8 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 588df9071f0f; files: src/OpenClaw.Tray.WinUI/Services/AccessibilityNavigationSignal.cs)
  • Pedro Larroy: Raw commit b6c849e adds tests/OpenClaw.Tray.UITests/TestSupport.cs:89 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b6c849e8ed44; files: tests/OpenClaw.Tray.UITests/TestSupport.cs)

Preflight source

Source 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

Metric Value Why it matters
Change distribution Production +87/-4; tests +128/-29; workflow/contracts +6/-3 Production growth implements the opt-in readiness boundary in its existing owner; test growth preserves distinct layout, transition, and lifecycle assertions without adding modules.

Labels

Label changes:

  • add P2: Intermittent UI failures and an undersized CI timeout consume contributor attention without establishing an urgent shipped-product regression.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Intermittent UI failures and an undersized CI timeout consume contributor attention without establishing an urgent shipped-product regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 12, 2026, 4:14 PM ET / 21:14 UTC.

…passing runs

Wait for observable state instead of fixed settle counts or one-shot lookups in the
flaky Tray UI tests, and fix the root causes found while reproducing them:

- Dashboards: require the hero column to be rendered for the target width (stale
  posted render reproduced: 196 = 820-64-560), wait for the replaced gallery to be
  laid out after an agent switch, and give the second widget a distinct sandbox
  URL so Chromium's cache lock does not hold its request for 20 s.
- Accessibility readiness: Settings pages publish the test-only page-ready signal
  once, after Loaded and after expand storyboards stop (was written before the page
  loaded by WorkspaceWindow.RenderSettings).
- Systems rows wait for expand storyboards to stop; Workspace waits for Inbox and
  history-button state; the question proof waits for the composer view model and
  visibility instead of fixed cycles and records lifecycle diagnostics.
- NextCompositionAsync and the native theme surface use the named render-wait
  budget instead of an unnamed 2 s literal, and report slow or missing frames.
- Raise the Tray UI step budget from 15 to 25 minutes (passing runs take 13-15).

Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant