Repository navigation
test(ui): await web push settle points instead of wall-clock waits - #180235
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Member
Author
|
Inherited red: |
RomneyDa
added a commit
that referenced
this pull request
Oct 22, 2026
…80235) Release adaptation: release/2026.10.6 keeps these tests in ui/src/app/web-push.test.ts with different cases, uses vi.resetModules(), and has no snapshot.read receipt, so the main change was ported by hand. Each vi.waitFor that waited on state behind the lazy web-push runtime import now settles on the capability publication, a deferred resolved by the Gateway mock when the awaited request (preferences.set, the VAPID key) arrives, or the Settings reconcile publication, bounded only by the test signal. The release helper nextPreferencesPublication is hoisted and shared; the lazy runtime failure test, which the release test order makes the first cold import, is also settled on its publication. (cherry picked from commit 1bfe96f)
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 22, 2026
…penclaw#180235) * test(ui): await web push settle points instead of wall-clock waits * test(ui): type the Settings read deferred for the ui-app test project
tideclaw-bot
pushed a commit
that referenced
this pull request
Nov 4, 2026
Backport #180235 with release-native publication settlement. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 20554c17d7c0eba60585aaacff7d47ebf73c7c6b)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes:
ui/src/app/web-push.test.tsx> "serializes rapid preference edits without dropping the latest full object" flaking on the Bun UI shard (CI run 39569175257 attempt 1,checks-ui (3/3):expected undefined to be truthyafter 1003ms; the same test passed in 103ms on Node).User Impact
There is no user-visible change. This removes a deterministic-tier CI flake from the Control UI Bun shard.
Why This Change Was Made
Root cause.
createWebPushCapabilityloadsweb-push.runtime.tswith a lazyimport(). In a Vitest worker that import is a module fetch from the Vitest main process: forks over IPC on Bun, threads on Node. The rest of initial reconciliation runs on microtasks, with no timers and no pending mocks. So whethersnapshot.preferencesis set depends on how fast the runner answers the fetch and schedules the worker. It does not depend on the code under test. The test wrapped that wait invi.waitFor, whose default 1000ms deadline is much shorter than the 60s test timeout. On the failing shard the 4-vCPU runner had load 5.4, with 3 Bun forks plus Chromium. Sibling tests in the same file were also slow there. For example, the fully event-driven "refreshes routed canonical profile defaults" test took 841ms on Bun and 2ms on Node. A slow import fetch or a stalled worker therefore loses the race against the 1000ms deadline. A longer timeout would only make that race less likely.Fix. Wait for the real settle points:
nextPreferencesPublicationhelper, moved to file scope and shared),preferences.set,push.web.vapidPublicKey),Each wait is bounded only by the test
signalthroughwithinTest. The same fix applies to the six sibling tests (two of them are theit.forSettings cases) whose first wait was gated on the lazy import. Each of them fails the same way under the reproduction below. The assertions are unchanged. Assertions that used to bewaitForconditions are now direct expectations after the settle point.Evidence
web-push.runtime.tsby 1.1s. I ran the target test alone under the pinned Bun withOPENCLAW_VITEST_FS_MODULE_CACHE=0:expected undefined to be truthyat 1004–1010ms, which matches the CI signaturewaitForpolls) and never failed locally, even under CPU stress. After the change, 20/20 Bun runs passed and the target test took 1–5ms.pnpm test ui/src/app/web-push.test.tsx --maxWorkers=1wall time is 3.4s on Node and 2.7s on Bun. Vitest reports a duration of 1.7s on Node and 1.2s on Bun for 23 tests. There is no added CI cost, and the file runs faster because thewaitForpolling intervals are gone.pnpm tsgo:ui, oxlint on the file (includingmax-lines, now 999 of 1000 counted lines),run-format --check, andgit diff --checkare all clean. Autoreview (Codex, P2 threshold) came back scoped-clean.origin/release/2026.10.6: the file there is stillui/src/app/web-push.test.tsand its tests have diverged (it has "keeps subscribers independent…" and "schedules initial reconciliation…" and callsvi.resetModules()). A release backport needs a manual port of the same settle-point pattern.