Repository navigation
fix(tests): avoid false failures during fixture startup - #137101
Conversation
Wait for lazy dialog modules before starting DOM readiness polling. Gate subprocess timeout fixtures on native readiness and exit events while keeping their original timeout, signal, pipe-drain, and ownership assertions. Reproduced four dialog failures with delayed real imports and two subprocess failures with delayed child startup; all six pass after synchronization. Normal caller/owner coverage: 672 tests passed, one platform skip. Changed gates and an independent Codex P0-P2 review passed. No production changes. Related: #136934 Fixes #136708
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: blocked before merge. Reviewed September 3, 2026, 2:51 AM ET / 06:51 UTC. ClawSweeper reviewWhat this changesThe PR updates UI dialog and subprocess test fixtures so lazy imports and child startup complete before the tests begin timing the behavior they are intended to assert. Regression provenancePossible regression — suspected (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 2 items remain No blocking source-level findings. This maintainer-authored PR preserves the asserted UI and process-cleanup behaviors while separating fixture bootstrap from their deadlines; exact-head CI remains the normal merge gate. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw tests use shared fixtures to launch modal dialogs and managed child processes, then verify UI actions, process termination, and inherited-pipe cleanup. These changes affect that test synchronization layer rather than shipped Gateway or Control UI behavior. flowchart LR
A[Lazy dialog module] --> B[Shared dialog fixture]
B --> C[DOM readiness assertion]
D[Child process startup] --> E[Gauntlet controller]
E --> F[Timeout and signal cleanup]
C --> G[UI test result]
F --> H[Process test result]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +97. Total +97 across 5 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the shared readiness boundary and native-event-driven process fixture, then merge once exact-head CI confirms the unchanged assertions across the supported environments. Do we have a high-confidence way to reproduce the issue? Yes, at source level: the prior waits began before lazy-import or child-readiness completion, and the PR supplies controlled delayed-start scenarios. Local execution is intentionally unavailable in this read-only review checkout. Is this the best way to solve the issue? Yes, provisionally: moving the synchronization into the shared dialog fixture and using native readiness/exit events keeps the existing assertion deadlines intact instead of extending them or weakening cleanup checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 71ccf5130b15. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Ready to land The Linux subprocess job ran both complete changed suites on Ubuntu 24.04.3: 104 passed, one existing Windows-only skip. Its actual log contains passing refusal/retry, inherited-stdio, UTF-8 trimming, and parent-termination-during-cleanup cases. This is hosted execution evidence, not just a green workflow badge. Local proof remains 672 passing caller/owner tests, six controlled RED→GREEN scenarios, and the passing changed checks documented above. The fresh ClawSweeper review reported no source defect. Its two before-merge evidence gaps are covered:
CI attempt 1 was retired only after a fresh 134-job census showed no executing jobs and one unassigned typecheck ( The historical same-worker Linux ordering remains unknown, as documented. Production LOC remains 0; all changes are test/fixture synchronization and cleanup. |
|
Merged via squash.
|
) Wait for lazy dialog modules before starting DOM readiness polling. Gate subprocess timeout fixtures on native readiness and exit events while keeping their original timeout, signal, pipe-drain, and ownership assertions. Reproduced four dialog failures with delayed real imports and two subprocess failures with delayed child startup; all six pass after synchronization. Normal caller/owner coverage: 672 tests passed, one platform skip. Changed gates and an independent Codex P0-P2 review passed. No production changes. Related: openclaw#136934 Fixes openclaw#136708
Closes #136708. Follow-up to the unrelated CI failures observed while landing the Android cleanup in #136934.
What Problem This Solves
Resolves false CI failures when cold dialog imports or native child startup consume short deadlines intended to test rendering, pipe draining, or termination behavior. Retrying the Android PR passed unchanged; it did not repair these races.
Why This Change Was Made
Fixture readiness now precedes the behavior clock. The existing modal helpers join lazy imports before starting their unchanged DOM waits; placement prerequisites use the same helper. They deliberately do not await the action being confirmed or an intentionally held RPC.
The terminal-child fixture starts its real drain budget at native exit. The gauntlet's isolated controller waits for actual descendant IPC readiness before driving its existing 200 ms timeout, verifies native child closure, then sends a real parent SIGTERM during the unchanged 150 ms kill grace. Native process-group inspection handles Linux zombies, and failure cleanup joins the harness and known children. The pre-exit marker/sleep inference and duplicate PID probe are removed.
The refusal/retry and UTF-8 initialization cases from #136708 were already repaired by 6187bd6; their complete owning suites remain covered here.
User Impact
No product or runtime behavior changes. No longer deadlines, retries, new configuration, dependencies, or weaker business assertions. Production LOC: +0/-0. Tests and test support: +160/-63 (net +97).
Evidence
Controlled regressions on base
2fffd4e8ba116813222b28b89179fd911784aeae, repeated after the fix:The Vite hook returns
nullafter its delay, preserving real module exports, components, catalog fixtures, and actions. Each delay overlaps the selected test. All four passing dialog probes finish after import release with zero remaining modals/body children, restored dialog methods, and no unhandled errors. Temporary delay injection is not in this patch.Normal final-source checks on Darwin/arm64, Node 24.19.0:
Commands:
Limits: the original interleaved Linux logs do not identify same-worker predecessor order, and the historical full shards were not replayed locally. Controlled failing synchronization regressions establish the mechanism. Exact-head hosted Linux CI is still required before landing. No browser screenshot is needed for these test-only changes. Historical introduction provenance is unknown; this does not attribute the flakes to the Android changes.
Follow-up: some generic dialog callers have owner-specific failure-teardown needs, especially token-reveal dialogs that intentionally reject cancellation. This patch preserves their behavior; blindly applying generic cancel-and-join cleanup would deadlock those fixtures.