Skip to content

fix(tests): Automations fixture tests time out selecting the app theme when Settings opens slowly - #2152

Merged
bkudiess merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-fixture-theme-select
Nov 13, 2026
Merged

bkudiess merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-fixture-theme-select

Conversation

@bkudiess

@bkudiess bkudiess commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: Automations mock Gateway UI tests that switch the app theme can time out when Settings opens slowly ("Timed out waiting for theme choice").

User Impact

User impact: there is no product change. Contributors get fewer false CI failures in the "Mock Gateway application and compatibility tests" job.

Why This Change Was Made

SelectAppThemeAsync navigated to Settings, waited only until the App theme ComboBox existed in UI Automation, and called Expand() once. While the page is still arriving, that early Expand() can be ignored. In the failing run, the dropdown was still closed 20 seconds later (failure screenshot), so the wait for the theme option timed out. When the requested theme was already selected, the old wait could also pass too early: the closed ComboBox already shows that theme's name, and the one-shot lookup that followed could then throw.

The helper now:

  • waits until the selector is on screen and enabled before calling Expand();
  • waits for the dropdown's own list item (ListItem with the theme name and a selection pattern) before selecting it.

This matches how the Usage and pinned-Connection tests already select a theme. Automations_ResponsiveShellWidthsHaveDistinctMeasuredFrames had an inline copy of the old steps and now calls the helper. As suggested by validate-test-timing-patterns.ps1, the timing baseline is lowered for the two removed one-shot lookups (72 to 70). The changes add no retries of actions, sleeps, fixed settle counts, skips, or weaker assertions.

Evidence

  • Failure observed: in a local full fixture run, Automations_HeroWashScrollsWhileTheBackplateStaysAnchored(Dark) failed with "Timed out waiting for theme choice". The failure screenshot shows the App theme ComboBox collapsed at the timeout.
  • Review: dual-model Hanselman review (Claude Opus 5.5 and GPT-6 Astra, high effort). Neither model found a blocking issue; GPT-6 Astra found none at all. Claude Opus 5.5 asked for waits on the dropdown's Expanded and Collapsed states, so a future failure names the step. Those waits are applied. A selection-value check was not added, because the selector does not expose the chosen theme through ValuePattern. The open LOW note is that the option search covers all app windows, the same as the existing theme selections.

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: test-only change to the mock Gateway fixture UI tests. CI runs these tests directly.

Validation

All runs were local on Windows x64 at 175% DPI, with isolated app and test profiles. Metadata for the real %APPDATA%/%LOCALAPPDATA%\OpenClawTray was unchanged after every run. Fixture runs used OPENCLAW_RUN_KEYBOARD_PROOF=1 and screenshots, matching CI.

Test (callers of SelectAppThemeAsync) Result
Automations_HeroWashScrollsWhileTheBackplateStaysAnchored (Light + Dark) 10/10 runs passed on the final helper
Automations_ResponsiveShellWidthsHaveDistinctMeasuredFrames 3/3 runs passed
Automations_ScopesToAgentsAndCoversMainStates (Light + Dark) 3/3 runs passed on the final helper, after one run hit a known local-only Axe BoundingRectangleSizeReasonable violation on a transient button (it also occurs locally without this change)
  • .\scripts\validate-test-timing-patterns.ps1: passed after -LowerBaseline.
  • ./build.ps1: all builds succeeded.
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 5849 passed, 0 failed, 29 skipped.
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 6410 passed, 0 failed, including TestDeterminismGuardTests, on main c7b75de.
  • After rebasing onto main 85c8ffa: HeroWash 3/3, ResponsiveShellWidths 2/2, Automations_ScopesToAgentsAndCoversMainStates 1/1. After rebasing onto main c7b75de (test(setup): fast-validation fails on main because setup tests look up the companion without waiting #2153, guard fix): .\scripts\validate-test-timing-patterns.ps1 passed; HeroWash 3/3, ResponsiveShellWidths 2/2.

Real Behavior Proof

  • Environment tested: local Windows x64 desktop, 175% DPI, isolated app and test profiles, mock Gateway fixture.
  • PR head or commit tested: bbcf4ee (on main c7b75de)
  • Exact steps or command run: dotnet test tests/OpenClaw.Tray.UITests -c Debug -r win-x64 -p:DevBuild=false --no-build --filter <test>, with the fixture environment from scripts/test-gateway-fixture.ps1.
  • Evidence after fix: the pass counts under Validation.
  • Observed result: see Validation.
  • Screenshot or artifact links verified? (Yes/No/N/A): N/A (local artifacts only).
  • Not verified or blocked:
    • The original failure was intermittent (1 in about 10 local runs), and there is no deterministic local before/after.
    • Automations_PinnedHostToggleHitTabAndBanner (keyboard-proof lane) also calls this helper. Locally it fails both with and without this change, at a later step: the Automations inventory row is below the fold at 1000×900 DIP on a 175% DPI display. It is not verified here.
    • CI on the previous head 6436667 (run 43378304604) failed only in the main-wide timing guard (fast-validation and the Tray guard test) before test(setup): fast-validation fails on main because setup tests look up the companion without waiting #2153. Mock Gateway, UI and Tray UI jobs passed. CI for this head 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: N/A

Compatibility and Migration

  • Backward compatible? (Yes/No): Yes
  • Config or environment changes? (Yes/No): No
  • Migration needed? (Yes/No): No
  • If yes, list the exact upgrade steps: N/A

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 13, 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 13, 2026
@clawsweeper

clawsweeper Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

The PR waits for usable theme controls and dropdown states, reuses the existing theme-selection helper, and lowers the timing-pattern baseline.

Example: An Automations fixture test selects Dark while Settings opens slowly.

  • Before: The helper can expand the selector before it is usable and later time out waiting for the theme choice.
  • After: The helper waits for the enabled, visible selector, confirms expansion, selects the Dark list item, and confirms collapse.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported repair with reported native fixture passes; intermittent reproduction and incomplete CI results limit validation confidence.
Proof confidence 🦐 gold shrimp (3/6) No shipped behavior changes, so separate product proof is unnecessary; reported Windows fixture repetitions support the repair, while the inspected linked images show the earlier setup redesign rather than this helper.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Contributors encounter false Automations fixture failures when Settings is slow to become usable.
Reason: The maintainer-authored change repairs a concrete test setup failure with a narrow existing-helper change and no product-policy change.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it is a focused, maintainer-authored test repair that remains absent from main, and no introduced correctness defect was found.

Priority: P3
Reviewed head: 6436667d91e293f3757970d63bfc209369e3a5b1

Before merge

None.

Findings

None.

Agent review details

How this fits together

Automations fixture tests drive the real Companion app through navigation commands and Windows UI Automation; the changed helper prepares the theme before existing rendering and interaction assertions.

flowchart LR
  A[Automations fixture tests] --> B[Existing theme helper]
  B --> C[Settings navigation]
  C --> D[UI Automation readiness]
  D --> E[Theme list selection]
  E --> F[Existing Automations assertions]
Loading

Technical review

Best possible solution:

Keep theme preparation in the existing helper with observable readiness checks and unchanged downstream assertions.

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

The old helper demonstrably waits only for selector existence and matching text before a one-shot selection; the author reports an intermittent timeout, but no deterministic before-and-after reproduction is supplied.

Is this the best way to solve the issue?

This is a proportionate repair: it reuses existing owners and UI Automation patterns, removes duplicated steps, and preserves the rendering assertions and timeout budgets.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 85c8ffa61872.

Provenance checked

  • Automations theme preparation keeps the original intent (994539b: The original Automations feature added theme-specific rendering and interaction coverage.)
  • Timing-pattern baseline keeps the original intent (ee8edbc: The ratchet prevents new timing-sensitive patterns while allowing existing occurrences to be removed and their baseline lowered.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

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 scope Production +0/-0; tests and baseline +21/-16 The small increase replaces duplicated selection steps with explicit readiness checks without adding production machinery.

Labels

Label changes:

  • add P3: This repairs intermittent contributor-facing fixture failures without changing product behavior.
  • 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:

  • P3: This repairs intermittent contributor-facing fixture failures without changing product behavior.
  • 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 13, 2026, 1:35 AM ET / 06:35 UTC.

…e when Settings opens slowly

SelectAppThemeAsync called Expand() on the App theme ComboBox as soon as it
existed in UI Automation, while the Settings page was still arriving, and the
expand could be ignored. It now waits for the selector to be on screen and
enabled, waits for the dropdown to report Expanded, selects the dropdown's own
ListItem (the closed selector already displays the current theme's name), then
collapses it and waits for Collapsed, matching the Usage and pinned-Connection
theme selections. The responsive-widths test reuses the helper instead of an
inline copy, and the timing baseline is lowered for the removed one-shot
lookups.

Co-authored-by: Copilot App <[email protected]>
@bkudiess
bkudiess force-pushed the bkudiess-fixture-theme-select branch from 6436667 to bbcf4ee Compare November 13, 2026 07:16
@bkudiess
bkudiess merged commit e2326cc into openclaw:main Nov 13, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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