Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
This PR fixes smoke-test harness isolation by ensuring the daemon rendezvous/runtime and cache are owned by the harness (not inherited from the caller), and adds a contract test to prevent regressions.
Changes:
- Add a new contract test that verifies
scripts/smoke-test.shdoes not leak callerCBM_RUNTIME_DIR/CBM_CACHE_DIRinto product processes and cleans up the private root. - Wire the new contract test into
scripts/test.sh. - Update
scripts/smoke-test.shto initialize a private runtime/cache viascripts/test-runtime.shand clean it up on exit.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/test_smoke_runtime_isolation_contract.sh | New contract test asserting smoke harness runtime/cache isolation and cleanup. |
| scripts/test.sh | Adds a new test step to run the smoke harness isolation contract. |
| scripts/smoke-test.sh | Initializes harness-owned runtime/cache and adds cleanup on EXIT. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # shellcheck source=test-runtime.sh | ||
| source "$REPO_ROOT/scripts/test-runtime.sh" | ||
| cbm_test_runtime_init | ||
|
|
There was a problem hiding this comment.
Handled as one lifecycle requirement in fa138acf: the runtime cleanup trap is armed right after cbm_test_runtime_init, and the fixture trap that replaces it runs cbm_test_runtime_cleanup before smoke_rmtree. Details in the PR comment.
| TMPDIR=$(cygpath -m "$TMPDIR") | ||
| fi | ||
| trap 'smoke_rmtree "$TMPDIR" "${DRYRUN_HOME:-}" "${CODEX_LIFECYCLE_HOME:-}"' EXIT | ||
| trap 'smoke_rmtree "$TMPDIR" "${DRYRUN_HOME:-}" "${CODEX_LIFECYCLE_HOME:-}"; cbm_test_runtime_cleanup "$BINARY"' EXIT |
There was a problem hiding this comment.
Handled as one lifecycle requirement in fa138acf: the runtime cleanup trap is armed right after cbm_test_runtime_init, and the fixture trap that replaces it runs cbm_test_runtime_cleanup before smoke_rmtree. Details in the PR comment.
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Thank you for isolating the smoke-test runtime. One remaining cleanup concern is that initialization occurs before the EXIT trap is installed. Please install cleanup immediately after successful runtime initialization, and ensure an earlier cleanup failure cannot prevent private-runtime cleanup. The duplicate inline observations can be handled as this one lifecycle requirement. |
|
Two updates, and one of them should save you some time. The That is the same symptom we just saw on an unrelated PR (#2207) at #2196 and #2197 merged today ( The open review item remains the one from 2026-09-19: install cleanup immediately after successful runtime initialization, and make sure an earlier cleanup failure cannot prevent private-runtime cleanup. That ordering concern is the real review point and it is worth getting right — the same trap exists in the sibling harnesses, and #2196 handles it by leaning on Thank you for this series. The soak and memlab halves landing today fixed a root cause that had been reddening other people's pull requests for weeks. |
scripts/smoke-test.sh retires the account daemon from seven call sites, but its wrappers sandbox only HOME/TMPDIR/CBM_CACHE_DIR and only CBM_RUNTIME_DIR moves the daemon rendezvous, so every retirement reached the operator's live daemon. Source scripts/test-runtime.sh so every product process runs under a harness-owned runtime and cache, and clean that root up from the EXIT trap. Add tests/test_smoke_runtime_isolation_contract.sh, which fails before this change, and wire it into scripts/test.sh. Part of DeusData#1696. Signed-off-by: Anton Standrik <astandrik@yandex-team.ru>
Review on DeusData#2199: cbm_test_runtime_init ran more than a hundred lines before the only EXIT trap, so under `set -e` a failure in the fixture mktemp or its cygpath conversion left the private root behind, and the fixture trap ran smoke_rmtree ahead of the runtime cleanup. Arm `trap 'cbm_test_runtime_cleanup "$BINARY"' EXIT` immediately after a successful init, as soak-test.sh and memlab.sh do. The fixture trap that replaces it now retires the private daemon first and removes the fixtures second, so no earlier cleanup step stands between the exit and the runtime cleanup; on Windows the retirement is also what unblocks the fixture rm. tests/test_smoke_runtime_isolation_contract.sh pins the early trap to the window between the init call and the first fixture; the pin fails against the previous head. Part of DeusData#1696. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Anton Standrik <astandrik@yandex-team.ru>
d14bc70 to
fa138ac
Compare
|
Rebased onto
Locally on macOS: the four runtime-isolation contracts, |
What does this PR do?
Part of #1696 (audit ledger), follow-up to #1691/#1695.
scripts/smoke-test.shstarts every product process of a smoke run and retires"the account daemon" through
daemon stopfrom seven call sites. Its wrapperssandbox HOME/XDG/TMPDIR and
CBM_CACHE_DIR, but onlyCBM_RUNTIME_DIRmoves thedaemon rendezvous (
src/daemon/bootstrap.c:231-241,docs/CONFIGURATION.md), soevery retirement landed on the operator's live account daemon: stopped when no
committed client was attached, or
FAIL ...: account daemon still activewhen onewas.
scripts/smoke-test.shsourcesscripts/test-runtime.sh, callscbm_test_runtime_initafter argument validation and runscbm_test_runtime_cleanup "$BINARY"from the EXIT trap. The wrappers(
smoke-local.sh,vm-smoke.sh) are unchanged: theirCBM_CACHE_DIRis nowoverridden by the harness-owned root, and the smoke-fixture contract pins stay valid.
tests/test_smoke_runtime_isolation_contract.sh: drives the harness with anenvironment-probe fixture under a caller
CBM_RUNTIME_DIR/CBM_CACHE_DIRandrequires that no product process receives them, that runtime and cache sit under
one private root, and that the root is gone after exit. No daemon is started.
Fails on
mainwithFAIL: smoke-test exposed the caller CBM_RUNTIME_DIR to a product process; passes with this change. Wired as Step 0t2 inscripts/test.sh.Not verified here: the Windows leg (
vm-smoke.sh→ protected-root helper path oftest-runtime.shwithoutCBM_CI_TEMP_ROOT) — CI only.Checklist
git commit -s)make -f Makefile.cbm test) — shell-only change; the newcontract plus
test_smoke_fixture_contract,test_venue_parity_contract,test_runtime_isolation_contractandtest_shell_line_endingswere run; thefull C suite was not run on this host
make -f Makefile.cbm lint-ci) — no C changes;scripts/check-no-test-skips.shrun