Skip to content

test(ui-react): establish paused liveness clock before navigation - #2316

Merged
schlessera merged 9 commits into
mainfrom
test/2298-liveness-clock-setup-07f4f991
Oct 17, 2026
Merged

schlessera merged 9 commits into
mainfrom
test/2298-liveness-clock-setup-07f4f991

Conversation

@schlessera

@schlessera schlessera commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Closes #2298

What changed

Liveness B establishes its paused browser clock before navigation and application timers. It temporarily fixes Date while applying pauseAt, then restores advancing Date semantics with setSystemTime while still paused. The selected pause time cannot expire in transit. The later Date.now() + 100 pause is removed; real sockets, host, IndexedDB, reconnect/resync and every original assertion remain.

Why this shape

The installed Playwright 1.63.0 source confirms that fixed Date and timer advancement are distinct and that setSystemTime leaves a paused clock paused. The helper uses only public clock APIs and the existing fictional 2026-07-12 midday date. It introduces no larger pause margin, sleep, product timer or test-deadline change. The browser regression also checks readiness before navigation, because navigation replay can otherwise hide an incorrectly fixed Date.

Proof

Implementation head 309f6f0a20e4bbcba141ea1e40241b2329551c6c, local tested base dcc09e9c8601f6513eec907cfbf7d3ffbc01bf16. Bun 1.4.2, Playwright 1.63.0, actual local Google Chrome 140.0.7339.127.

  • Failing first: the original target-read/pause sequence under a real-browser 150ms controlled command-delivery fault fails LIVENESS_CLOCK_SETUP_SURVIVES_PROTOCOL_DELAY with the actual Cannot fast-forward to the past error. The original full-preflight failure remains preserved separately on tests: liveness clock pause races its own browser time read #2298.
  • Restored helper: 2 real-browser controls / 18 assertions pass, checking delayed and ordinary delivery, immediate readiness, navigation replay, pinned date, no automatic timer advancement and exact 19/20ms timer/date boundaries. Browser HTTP is blocked in these isolated data-page controls; contexts and overridden clock descriptors are restored in finally.
  • Removing fixed Date fails the protocol-delivery control. Removing advancing Date restoration fails LIVENESS_CLOCK_READY_BEFORE_NAVIGATION; both guards are restored.
  • The actual complete liveness case passes 1 test / 9 assertions with the real host/socket/IndexedDB. Mutating the production idle default to 15001 fails BROWSER_DEFAULT_IDLE_AT_BOUNDARY. Suppressing replacement fails the existing native second-connection completion guard after the exact response boundary. Production source is restored byte-for-byte.
  • Required bun run check:pr --base origin/main passes: 54 fast tests / 181 assertions plus all 26 affected tests / 192 assertions. This includes the complete 24-case answer-delivery runtime file and both clock controls. Full package build occurs in that original fixture setup. Strict types, lint and leakage pass.

Current candidate head 70912620092f5d0117a3efee458ee49812540de4 integrates main 19b43c6d7e4d8e2b44b614fd6e0d431746349f90. Fresh required preflight passes 54 fast tests / 181 assertions plus all 26 affected browser tests / 192 assertions, zero failures/skips; strict types pass. All 24 answer-delivery cases and both clock controls execute, including cleanup. Only the original three clock test/fixture files differ from main.

Earlier confirmations retain their exact identities on #2298. One failed on the independently tracked full-build setup timeout and diagram binding defect; the diagram repair (#2314) and narrower runtime build (#2320) are delivered. Subsequent requests became stale as main advanced and were cancelled, without a complete hosted pass. Integrated changes since that failure include native/module/relay fixture corrections, build/discovery diagnostics, HTTP mount fixtures, monotonic probe timing explicit GPT-Live export, and inaccessible private-state parent masking. The latest adapter opens a connection only when selected; this keyless fixture does not select it. Clock setup and original liveness assertions are unchanged.

Checklist

  • Complete selected current-candidate hosted proof; actual merge/main verification follows delivery.
  • Focused failing-first, restored guard mutations, full affected local preflight and strict types pass at their attributed identities.
  • Release 0.44.0 assigned to PR and issue.
  • No changeset: test/fixture-only contribution.
  • Leakage passes; no integration contract, product timer/deadline or original behavioral assertion change.

Hosted qualification

Confirmation 39035312441, attempt 1 passes all thirteen selected proof jobs plus metadata and the final aggregate. Every selected execution identifies merge cc753a9430583e3724db7103c0d13e4bf57fcc5e, tree b6ee7282dc817b8c4d983e9ed17524353f69f9e6, ordered parents [19b43c6d7e4d8e2b44b614fd6e0d431746349f90, 70912620092f5d0117a3efee458ee49812540de4]; requested base and independent live main agree. Twelve category resource receipts and verification checkout were independently reconciled; no retained executions. Packaging is intentionally unselected for this test-only contribution. The head-only contract gate passes separately.

Unit artifact unit-proof-2 (12102216736) records both clock controls passing 2 tests / 18 assertions, zero failures/skips. Artifact unit-proof-4 (12101658768) records all 24 answer-delivery cases / 174 assertions, zero failures/skips; Liveness B reaches all 9 assertions. The aggregate's candidate receipt validates the same head/base/tree. Historical failed/cancelled requests retain their original identities and are not this successful run.

Anything left open

No implementation or pre-merge qualification gap. Actual squash/main verification follows merge. The broader #2279 investigation remains separate; this fixture correction does not claim to resolve it.

@schlessera schlessera added this to the 0.44.0 milestone Oct 17, 2026
@schlessera schlessera added type: test Coverage, harness or proof work with no behaviour change. area: ui-react React chat/files/voice components, stores, WebSocket transport. area: ci CI workflows, the gates they run, release scripts, packaging. labels Oct 17, 2026
@schlessera
schlessera marked this pull request as ready for review October 17, 2026 10:44
@schlessera
schlessera marked this pull request as draft October 17, 2026 10:52
@schlessera
schlessera marked this pull request as ready for review October 17, 2026 10:57
@schlessera
schlessera marked this pull request as draft October 17, 2026 11:02
@schlessera
schlessera marked this pull request as ready for review October 17, 2026 12:28
@schlessera
schlessera marked this pull request as draft October 17, 2026 12:31
@schlessera
schlessera marked this pull request as ready for review October 17, 2026 12:34
@schlessera
schlessera marked this pull request as draft October 17, 2026 12:36
@schlessera
schlessera marked this pull request as ready for review October 17, 2026 12:39
@schlessera
schlessera marked this pull request as draft October 17, 2026 12:49
@schlessera
schlessera marked this pull request as ready for review October 17, 2026 12:52
@schlessera
schlessera marked this pull request as draft October 17, 2026 12:58
@schlessera
schlessera marked this pull request as ready for review October 17, 2026 13:08
@schlessera
schlessera merged commit bfaf3be into main Oct 17, 2026
28 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, the gates they run, release scripts, packaging. area: ui-react React chat/files/voice components, stores, WebSocket transport. type: test Coverage, harness or proof work with no behaviour change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests: liveness clock pause races its own browser time read

1 participant