Repository navigation
test: remove five timing races from CI - #4800
Conversation
Size Report
Startup median (7 runs, lower is better):
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 7011edd. The verdict and the full list are in the summary comment.
| const deadline = Date.now() + SNAPSHOT_TRANSITION_TIMEOUT_MS; | ||
| let missing = [...expected]; | ||
| let lastDiff: unknown; | ||
| for (let attempt = 1; Date.now() < deadline; attempt += 1) { | ||
| const diff = await runStep(context, `${step} (attempt ${attempt})`, ['diff', 'snapshot', '-i']); |
There was a problem hiding this comment.
No longer raised on 4409098.
🟡 Minor · waitForSnapshotDiffLines aborts the scenario on one failed diff step
One diff snapshot -i returning non-zero kills the scenario instead of retrying under the 10 s deadline the wait exists to honour. The call passes no step options, so assertStepOutcome takes its unexpectedFailure path and throws an AssertionError rather than continuing the loop.
| const deadline = Date.now() + SNAPSHOT_TRANSITION_TIMEOUT_MS; | |
| let missing = [...expected]; | |
| let lastDiff: unknown; | |
| for (let attempt = 1; Date.now() < deadline; attempt += 1) { | |
| const diff = await runStep(context, `${step} (attempt ${attempt})`, ['diff', 'snapshot', '-i']); | |
| const diff = await runStep(context, `${step} (attempt ${attempt})`, ['diff', 'snapshot', '-i'], { | |
| allowFailure: true, | |
| }); |
Details
Also raised here
Also raised at this location by persona maintainability: New diff wait retries only wrong lines; a failing diff command aborts the wait at once — A diff snapshot step that fails outright (daemon hiccup, non-zero run, rejected runStep) rejects waitForSnapshotDiffLines on the first attempt, failing the CI lane on a single transient error instead of polling on. Only a well-formed diff that has not caught up is retried; there is no catch around the awaited runStep. The sibling pixel wait the design mirrors keeps observing until the deadline when its captures keep failing (live-surface-transition.test.ts asserts that case reports the last capture error at the deadline), so the new helper is less resilient than the one it was copied from, and it is there the same flake class will reappear.
persona: senior-developer, maintainability
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
The upload deadline guard counted event-loop turns for two socket answers, so slow finalize IO ended the count with no answer read. It now settles on the socket data, under the existing 3 s guard. The webOS tunnel probe read an empty pid file as pid 0, and signal 0 to pid 0 always succeeds. A cancel that landed before the shell wrote its pid left the probe reporting a running tunnel forever. The Limrun fixture server read each request body without handling a client that cancels mid-upload, which surfaced as an unhandled rejection after every test had passed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…or slow captures A diff read right after Back could still describe the automation route. The lane now reads chained diffs until the transition is reported, and fails at a 10 s deadline when it never is. One launcher capture took 6.7 s on a hosted emulator, above the 5 s per-attempt cap, so no attempt of the 10 s surface wait could finish. The cap is now 15 s and the wait holds two capped attempts. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The inline cancel handling took the fixture server handler over the complexity threshold of the code health audit. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Found 1 test failure on Blacksmith runners: Failure
|
The mutation config left out the global setup that names the run's checkout-local directory. A test that requires that directory fails on CI without it, so the dry run of any kernel that owns such a test stopped every shard before a report. Both configs now share one list. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
602a4aa to
4409098
Compare
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
This PR is ready at 4409098. It changes tests, fixtures and test config only, and all checks pass, including Android smoke and every mutation shard.
Not blocking: the Back-diff wait has not run against the old failure on an emulator, and one green Android smoke run does not prove the two smoke races are gone, so watch the next few runs on main. |
* origin/main: test: remove five timing races from CI (callstack#4800) refactor(remote): save a remote script from memory with the local publisher (callstack#4802)
* origin/main: feat(gesture): hold before the move with gesture pan --hold-ms (#4767) docs: clarify device verification and security proposals (#4805) fix(daemon-client): say that a hung daemon is stopped before ensureDaemon starts a new one (#4803) test: remove five timing races from CI (#4800) refactor(remote): save a remote script from memory with the local publisher (#4802) refactor(apple-runner): one RUNNER_ERROR_CODES row per runner error code with parity/docs gates (#4774) fix(android): require acknowledgements for test IME typing (#4722) feat(scroll): add scroll refresh for pull-to-refresh (#4770) refactor(host-kit): add request Scope and use it for the wait capture deadline (#4794) fix(android): let permission all change nothing on an app that declares no permissions (#4796) fix(cli): replace the CLI session and generated remote config instead of rewriting them in place (#4797) fix(host-kit): accept a group-writable script directory the user owns (#4799)
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Summary
Five tests failed on unrelated heads. Every race is in test code; production is unchanged. 12 files.
diff snapshotran before Settings rendered. The lane reads chained diffs until the transition is reported, or fails at 10 s.Mutation harness
Scope expansion. The mutation config left out the global setup that names the run's checkout-local directory, so a test that requires it failed every kernel-errors dry run. Both configs now share one list.
Validation
Head 4409098: CI passes, including Android smoke and all mutation jobs (failed at 602a4aa). Lint, typecheck, format clean.
Same injection on base 74771e1 (fails) and head (passes):
[]).true !== false).Error: aborted).overlay.test.tsunder the mutation config withCI=1, 13 fail, then 13 pass.Back diff: new scripted test only.
Head fails on a real defect: expiry answer removed (3 s), tunnel left running (3 s), cache retry removed, surface or diff never changing (deadline).
Loop under CPU load: upload 50/50, webOS 50/50, Limrun 50/50.
Risks: one Android smoke pass does not prove the two smoke races gone. No independent reviewer.
🤖 Generated with Claude Code