Repository navigation
Fix two flaky tests: the settle clock test and parity-browser's waitfor cell (#168) - #381
Merged
Merged
Conversation
…ot the runner's
"the settle's real clock" compared real elapsed time with a constant of 0 and failed on the hosted runner
("waited 53.19 ms after a click whose constant is 0"). It now drives the real ActionSettler through the
service on an injected clock (its now/sleep seams): the call after press_key sleeps exactly 100 ms, before
that call reaches the engine, and the call after a click whose constant is 0 sleeps not at all.
Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
… not which deadline won (#168) api/browser-playwrightlocator/waitfor's locator-contract-diagnostics-no-matches waits 100 ms for an absent selector, and whichever deadline runs out first names the error's first line: the locator's ("Playwright selector deadline exceeded") or a CDP command's own (Runtime.evaluate's 1 ms, or Page.createIsolatedWorld's on a slow scratch tab). Both hosts' assertions passed while the diff went red on load alone, about half of parity-browser's runs. No deadline closes that race, since the last poll's command always gets what is left, so the cell now catches the error and returns that a deadline named it, its code, and the context and diagnostics lines after it byte for byte; the check holds those to the vendor's contract as before. A test runs the cell against each first line seen on real Chrome and requires one observation. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
Moved to Resolved with the scenario fix (b1d4cc0) and its five green parity-browser runs. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…381 review) The fake sleep resolved at once, so a read that called settler.wait() without awaiting it left the same sleep record and passed. The sleep is now held: while it is, clipboard_release (which never waits) goes to the engine, and since the engine runs requests in order, the held read must not be ahead of it; once the test wakes the sleep, the read reaches the engine. A missing await, a read sent before its wait, and a settle 1 ms too long each fail it. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
SSFSKIM
added a commit
that referenced
this pull request
Nov 15, 2026
Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
SSFSKIM
added a commit
that referenced
this pull request
Nov 17, 2026
Main brings #374's Show Menu confirmation, #382's scroll, #368, #381 and #171 M4. Conflicts resolved by keeping both sides: Input.swift's meta (typeReadback, keyEffect and menu), the engine service's per-call and optional meta keys and its header, the service test (#354's and #374's tests both), the spec's errors list (menuUnconfirmed and typeUnconfirmed), the surface inventory's Table 3 sections (#354's, then #374's), PROVENANCE.md's agent-cursor row (#374's fourth-paragraph sentence and #354's sixth paragraph), and repl-parity's docs oracle, rebuilt from main's fourth and fifth paragraphs and #354's sixth so it equals agent-cursor.md byte for byte. Sminos-Session: cursor235#b93055dd (cua on macbook)
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.
Two flaky tests that cost #171's gates repeated reruns. Both fixes are in the tests, and neither changes product code.
(a) The settle's clock test (
test/services-engine-linux/service.test.mjs)The test compared real elapsed milliseconds with a constant of 0 and failed once on the hosted runner ("waited 53.19 ms after a click whose constant is 0"). It now runs the real
ActionSettlerthrough the service on a clock the test keeps (the settler's existingnow/sleepseams), so only its sleeps move time. Each sleep stays pending until the test releases it (a review finding: a sleep that resolved at once let a read that never awaited the settle pass). While the sleep afterpress_keyis held,clipboard_release, which never waits, goes to the engine. The engine runs requests in order, so the held read must not be ahead of it. Once the test releases the sleep, the read reaches the engine. The test still guards the same property: the call afterpress_keysleeps exactly its 100 ms before it reaches the engine, and the call after a click whose constant is 0 doesn't sleep.Evidence:
test/services-engine-linux/*.test.mjs63/63 on 74af416. I checked that the test catches real regressions by breaking the code on purpose, each change reverted afterwards:settler.wait()withoutawait(the reviewer's mutation): fails, the engine got['list_windows', 'clipboard_release']while the settle was held[101]for[100]ci-gate
testgate on 74af416: GREEN, https://github.com/SSFSKIM/cua/actions/runs/43669910514 (9m58s). parity-browser was not rerun: this commit touches only the settle test.(b) parity-browser's
api/browser-playwrightlocator/waitforcelllocator-contract-diagnostics-no-matchesWhichever deadline ran out first wrote the error's first line: the locator's ("Playwright selector deadline exceeded") or a CDP command's own. The committed evidence shows the command's wording as Runtime.evaluate with 1 ms left, or Page.createIsolatedWorld on a slow scratch tab. Changing the deadline can't stop this race, because the last poll's command always gets whatever time is left. So the fix is in the scenario, as the issue asks, not an allowance. The cell now catches the error and returns three things: that a deadline named it, its code, and the context and diagnostics lines after it, byte for byte. The check holds those to the vendor's contract as before.
TDD: a new test runs the cell against each first line seen on real Chrome and requires one observation. It failed before the fix (each first line reached the observation) and passes after it. It also rejects a wait that finds the selector, an error that names no deadline, a missing diagnostics line, a missing context line, and diagnostics that found a match.
test/repl-parity/locator-contracts.test.mjs: 17/17.parity-browser on b1d4cc0, five runs in a row, all green:
testandplugin)The tracker's entry for this race moves to Resolved.
Not in this PR
api/browser-cuaapi/dragcell (one failure in the first 8 runs, not seen in these 5), is not addressed here.prto parity-browser'son:in.github/ci-kit.yml, stays with CI-opt. Its comment there still says the gate is off pull requests until the racy cells are fixed.Refs #168
Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)