Repository navigation
test(cli): give the spawn progress flow a stable bound - #1976
Conversation
The spawn wait flow ran on a 1.5 s inactivity bound while its script wrote twelve notes 0.3 s apart and then exec'd the real app-server. Because exec keeps the pid and the app-server's counters start over, progress stopped extending the wait after the script's last note, so a scheduling gap on a loaded macOS runner ended the wait before hello. Give the flow the production ten-second bound, twenty notes 0.6 s apart, which still lasts about twelve seconds, and leave the assertions, the neighbouring flows and the product default unchanged. With progress notes no longer extending the wait the flow still fails with the startup timeout, so it has not become weaker.
eric8810
left a comment
There was a problem hiding this comment.
Reviewed 2cb5e42. No blocking issue in the patch itself. The wrapper still takes ~12 s before exec, longer than the 10 s inactivity bound, so the test still depends on assembly notes extending the wait. The product default and assertions are unchanged.
The modified flow passed in Linux CI, but ci-ok is red: managed_oauth_flow::managed_provider_selection_http_recovery_and_restart_flow timed out at managed_oauth_flow.rs:1010. That's outside the changed fixture; I haven't verified that it's a pre-existing flake. I'm leaving this as a comment rather than approving a red run. The macOS native job doesn't exercise this CLI flow, so the original flake still needs confirmation in the macOS verify runs.
|
Review: #1976 (review) The 12-second script against a 10-second bound is intentional: the flow exists to prove that assembly notes extend the wait past the bound, and a mutation check that removes the note renewal fails the flow with the startup timeout. The product default and the assertions are unchanged. Both red tests in run 44905819992 are outside this diff. The new head, 7c16830, merges the current Agreed that the macOS effect can only be confirmed by the |
eric8810
left a comment
There was a problem hiding this comment.
Rechecked 7c168300. The fixture is unchanged by the main merge and an_assembly_note_is_waited_for_before_the_spawn_answers passes again in the exact-head Linux run. The previous collaboration/OAuth failures are not the failures in this run. ci-ok is still red: the recovery wake test read a sequence inside an atomic batch, the staged updater recovery fixture failed during installer setup, and the goal evaluator test did not wait for its evaluator. None of those assertions are in the changed fixture; this run doesn't establish their cause. Holding approval while the required check is red. The hosted macOS native check does not run the changed CLI flow.
|
The The The This pull request changes only |
eric8810
left a comment
There was a problem hiding this comment.
Reviewed at head 1dcc14f.
The diagnosis holds together and the fix is confined to the three numbers that caused it. The flow starts the CLI against a wrapper that emits 12 assembly notes at 0.3 s spacing and then execs the real app-server; the note carries the wrapper's pid and only a larger counter extends the wait, while the app-server's own counters restart at 1 and are therefore not an increase over the script's 12. That is a real gap in the flow's assumptions, not a slow machine, and it explains both signatures (did not start in time, App Server did not answer hello) with an empty daemon log.
Raising the bound to 10 s is the right knob rather than an assertion change: the test's subject is that an assembly note is waited for before the spawn answers, and the bound is the harness's patience, not the behaviour under test. Using the product's own 10 s default instead of a special 1.5 s value also removes a second thing that could drift away from the product. Spacing the notes at 0.6 s and running 20 of them keeps the script phase longer than the bound, so the notes keep extending the wait as intended until exec.
Blocking: none.
Checks are green at this head. I read the diff (three numeric changes in one test), the PR body's account of client.rs:434, and the file list; I did not read the surrounding flow or re-derive the counter comparison from client.rs myself, and ran nothing.
Non-blocking:
crates/dimcode/tests/cli_flow/daemon_startup_progress.rs— the flow now spends ~11.4 s in the wrapper script and up to 10 s in a genuine failure, where it used ~3.6 s and 1.5 s. That is the price of removing a flake and I would pay it, but it is the kind of change that adds up across a suite whoseverify (linux)run is already several minutes; if this file's neighbour flows grow the same way, a shared helper with one documented bound would keep the cost in one place.
zerob13
left a comment
There was a problem hiding this comment.
This test-only change still makes the wrapper exceed the initial inactivity deadline and requires successful startup through assembly progress. The revised fixture passed on exact Linux CI, and the aggregate gate is green. The selected macOS native checks passed but did not run that specific CLI fixture. Exact CI.
Symptom
daemon_startup_progress::an_assembly_note_is_waited_for_before_the_spawn_answersfails intermittently onmaininverify (macos), reportingdid not start in timeorApp Server did not answer hello during startupand an empty daemon log. It failed 4 times in 19mainmacOS runs.Cause
The flow starts the CLI against a wrapper script that writes 12 assembly progress notes 0.3 seconds apart and then
execs the real app-server, with a test-only wait bound of 1.5 seconds. The note carries the wrapper's pid and only a larger counter extends the wait;execkeeps that pid, while the app-server's own counters start again at 1, so they are not an increase over the script's 12 and are ignored (crates/dim-cli/src/client.rs:434). Progress therefore stops extending the wait after the script's last note, and any scheduling gap longer than 1.5 seconds between two notes ends the wait before the app-server can answer. The product default is not involved: it is 10 seconds.Change
Three numbers in that test only:
DIM_TEST_DAEMON_START_TIMEOUT_MSfrom 1500 to 10000 milliseconds, the script's note count from 12 to 20, and the sleep between notes from 0.3 to 0.6 seconds. The notes still last about 12 seconds in total, longer than the new bound, so the flow still proves that the spawn wait is extended past its bound by assembly progress. Assertions, neighbouring flows and the product default are unchanged.Why the flow is not weaker
A mutation check: with progress notes temporarily made to not extend the wait, the same flow fails with the startup timeout. The flow therefore still fails when progress is ignored, as the original one did.
CI
The workflow runs the
verifyjob for pull requests on Linux only; the macOS job runs on pushes tomain. This flow was run on macOS locally, andmain'sverify (macos)after merge is where the intermittent failure is confirmed gone.