Repository navigation
test(update): report the installer's output and link the test binary - #1994
Conversation
The staged-update flows copied the debug dimcode binary into every test home under /tmp: 571 MiB per flow, 28 copies in a full run. A /tmp quota exhausted by them failed the flow with only "exit status: 1". The fake installation tree now lives under the test target's temporary directory, beside the built binary, so each flow links that binary instead of copying it; the test home stays under /tmp. The one native entry the fake package manager writes is linked the same way. A link that cannot be made still installs a copy, and a failed install now reports its command, exit status, stdout and stderr. The installed package flow prints its terminal transcript when its exit status assertion fails. Fixes #1987
eric8810
left a comment
There was a problem hiding this comment.
Reviewed at head 9c64c02.
This addresses the failure I have reported against four other PRs in this queue, and it addresses it at the cause rather than by widening a timeout. The staged-update flows put a copy of a 571 MiB debug binary into every fake installation under /tmp, so a staged_update:: run wrote ~16 GB there and a machine with a small /tmp quota failed the flow at install_updater with exit status: 1 (#1987). Two changes fix that honestly:
- The fake installation tree moves to
CARGO_TARGET_TMPDIR, beside the built binary, so a hard link is possible;install_updaterlinks and falls back toinstallonly when the filesystem refuses. The test home stays under/tmpbecause its socket paths need it — that is the right split, and theInstallRootDropremoving the tree is what keeps the space from accumulating when a flow fails mid-build. - A failed install now reports its command, exit status, stdout and stderr. That is the part worth keeping even after the quota problem is gone: the previous failure cost me several windows of guessing because all the harness said was
exit status: 1.
cli_daemon_flow.rs gained the same treatment for the terminal transcript, which turns "update reported failure" into an assertion message someone can act on.
verify (linux) and ci-ok failed on this head, and not in the update suite:
crates/dim-app-server/tests/managed_oauth_flow.rs:1389
managed_oauth_flow::managed_provider_selection_http_recovery_and_restart_flow
called `Result::unwrap()` on an `Err` value: Elapsed(())
486 passed; 1 failed
An Elapsed from a wait inside a managed-provider flow that this PR does not touch — the same cluster of timeout-shaped failures I have seen on other heads. Worth a re-run before reading it as a regression.
Not approving while a required check is red.
Non-blocking: none.
eric8810
left a comment
There was a problem hiding this comment.
Reviewed at head 971acd0.
The PR's own change since the head I read is one fixture step, and it is the right one: the flow now sends a session.state notice and then reads requests in a loop, answering the session.context.usage re-read with unknown_method until account.providers arrives. That mirrors what the product does — a state report marks the context reading stale, the host asks again — instead of assuming the next request is the providers read. Keeping the fixture honest about the method it does not implement, rather than silently tolerating it, is what makes the loop readable.
The earlier substance still stands: the fake installation tree under CARGO_TARGET_TMPDIR with a hard link and an install fallback, the InstallRoot drop, and the installer output on failure that ended the guessing I had been doing over exit status: 1.
verify (linux) and ci-ok failed on this head, in two suites this PR cannot reach:
mcp_import::a_project_token_covers_the_withheld_records_for_update_and_remove
storage_flow::a_slow_store_upgrade_reports_progress_and_keeps_the_opening_alive
615 passed; 1 failed (and 486 passed; 1 failed in another suite)
The second is the store-upgrade opening path I flagged on #1986 two days ago, still red on main's lineage; the first is MCP import. Neither touches staged update. Not approving while a required check is red.
Non-blocking: none.
Verification: not run — I read the fixture delta and the failing test names; I did not read the other 49 commits (main merged in) or the rest of this PR's tests.
eric8810
left a comment
There was a problem hiding this comment.
Reviewed at head 971acd0.
Approving now that the checks are green, citing my review at this same head. That review found no blocking issue: the fixture step it added — a session.state notice followed by a read loop that answers session.context.usage with unknown_method until account.providers arrives — matches what the product does when a state report marks the context reading stale, and it is better than assuming the next request. The earlier substance stands too: the fake installation tree under CARGO_TARGET_TMPDIR with a hard link and an install fallback, InstallRoot's drop, and the installer output on failure that replaced a bare exit status: 1.
At the time I reviewed it, verify (linux) was red in two suites this PR cannot reach (mcp_import::a_project_token_covers_the_withheld_records_for_update_and_remove, storage_flow::a_slow_store_upgrade_reports_progress_and_keeps_the_opening_alive). Those are green at this head.
Verification: not run — this approval rests on the read recorded at this head plus the current check set (changes, verify (linux), macos-native, ci-ok all success).
The staged-update flows installed their own copy of the built
dimcodebinary into every test home, and those homes live under/tmp. The debug binary is 571 MiB, so one run ofstaged_update::wrote about 16 GB there, and CI machines whose/tmpquota ran out failed the whole flow ininstall_updaterwith onlyexit status: 1(#1987).The fake installation tree now lives under the test target's temporary directory (
CARGO_TARGET_TMPDIR), beside the built binary, so the two share a filesystem andinstall_updaterhard-links the binary into each fake package instead of copying it. The test home stays under/tmp, where its socket paths belong; only the installation tree moved. A filesystem that refuses the link still gets aninstallcopy, and a failed install reports its command, exit status, stdout and stderr. The one native entry the fake package manager writes is linked the same way. The update flow on an installed package incli_daemon_flow.rsprints the terminal transcript when its exit-status assertion fails.Copies per full
staged_updaterun: 29 before, each 571 MiB (about 16 GB written); 0 after. The 29 were 28 copies made while installing the fake package plus the one native entry the fake package manager copied; both now link the binary instead. Each flow removes its installation tree when it ends, including when it panics.The tests still launch
updatefrom inside a fake npm package whosebin/dimcodeis exactly the build under test; no assertion or timeout changed, only the way that file reaches the package.Fixes #1987