Repository navigation
tests: pause the runtime adapter's launches at named steps, and replace the checked images - #869
Merged
Pedro Henrique Penna (ppenna) merged 1 commit intoOct 25, 2026
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Post-spawn pauses consume the startup timeout, causing sufficiently long inspections to terminate an otherwise healthy VM on resume.
1 open issue
What changed in this PR
This PR extends the runtime test adapter with named launch hooks and VM scenarios for checked-image replacement, building on the staged-image handoff work in #822.
Changes:
- Adds pause and immediate-exit hooks at four launch steps.
- Tests image replacement protection, claim release after exit, and launch state at each step.
- Adds asynchronous test helpers with paused-process cleanup and documents the hook contract.
| File | Description |
|---|---|
tests/runtime-adapter/tests/vm_steps.rs |
Adds VM tests for replacement protection and launch hooks. |
tests/runtime-adapter/tests/step_hook.rs |
Tests hook parsing, pauses, and usage errors. |
tests/runtime-adapter/tests/common/mod.rs |
Adds asynchronous command helpers and cleanup. |
tests/runtime-adapter/src/lib.rs |
Exposes and documents the host-only hook module. |
tests/runtime-adapter/src/hook.rs |
Implements named pause and exit actions. |
tests/runtime-adapter/src/bin/runtime-adapter-host.rs |
Reads hook configuration and invokes launch steps. |
tests/runtime-adapter/README.md |
Documents hooks, exit status, and new scenarios. |
Review effort: Balanced
This was referenced Oct 24, 2026
Pedro Henrique Penna (ppenna)
force-pushed
the
esaurez/822-pr02-checked-handoff-20261023
branch
from
October 25, 2026 12:52
5476878 to
eb02d28
Compare
Base automatically changed from
esaurez/822-pr02-checked-handoff-20261023
to
dev
October 25, 2026 13:47
Pedro Henrique Penna (ppenna)
force-pushed
the
esaurez/822-pr03-handoff-replacement-20261023
branch
from
October 25, 2026 13:58
84f307c to
a5b8f25
Compare
Pedro Henrique Penna (ppenna)
force-pushed
the
esaurez/822-pr03-handoff-replacement-20261023
branch
from
October 25, 2026 14:18
a5b8f25 to
e321a44
Compare
Pedro Henrique Penna (ppenna)
force-pushed
the
esaurez/822-pr03-handoff-replacement-20261023
branch
from
October 25, 2026 14:32
e321a44 to
3eca25f
Compare
runtime-adapter-host launch takes a test-only step hook from RUNTIME_ADAPTER_STEP_HOOK. At a named step (checked, spawned, ready, or commit), STEP:pause:PATH creates PATH with the step's name and waits until it is gone; STEP:exit exits with status 5 without unwinding, as a crash would. Invalid hooks are usage errors. Leave time paused at spawned and ready out of the startup deadline, so a long inspection resumes without timing out a healthy VM. The VM scenarios replace checked image paths, verify that the guest uses the checked originals, check claim release after a crash-like exit, and inspect the launch state at every step. Use the upstream staged module for the staged bindings. Shared test helpers end any host command left paused before cleaning up its VM. Part of #822. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pedro Henrique Penna (ppenna)
force-pushed
the
esaurez/822-pr03-handoff-replacement-20261023
branch
from
October 25, 2026 14:45
3eca25f to
a073ecf
Compare
Pedro Henrique Penna (ppenna)
deleted the
esaurez/822-pr03-handoff-replacement-20261023
branch
October 25, 2026 15:01
This was referenced Oct 26, 2026
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.

Part of #822: PR 3 of 11, replacement between the check and OpenVMM's open (C5).
The prerequisites #863 and #867 have merged. This PR is rebased onto
origin/devat6af32ba0and contains only the step-hook and checked-image replacement work, withthe review and rebase fixes folded into its original commit.
What changed
runtime-adapter-host launchtakes a test-only step hook, the newruntime_adapter::hookmodule, fromRUNTIME_ADAPTER_STEP_HOOK:STEP:pause:PATHcreates PATH with the step's name, then waits until the file is gone. The launch leaves the time paused out of its startup deadline, so a test can pause it for as long as it needs;STEP:exitexits at once with status 5, without unwinding: the launch ends nothing that it started, and the system releases its descriptors or handles, as a crash would.checked: after the checks of the staged bindings; the launch holds the checked files and the scratch image's claim, and has begun nothing.spawned: the VMM runs, and the journal records it.ready: the guest assembled the root, and the checked files are released.commit: just before the commit.Step.vm_steps.rs(new, in VMs):checkedwhile files of zeros, which no guest could assemble or mount, try to take the image's and the scratch image's paths. On Linux they take them, and the guest still assembles the checked originals and writes nothing to the replacements. On Windows the replacements, deletions, and an open of the image for writing all fail until the guest is ready, after which the images can be renamed again.checked, which leaves no journal, VMM log, runtime record, or launch record, and whose exit released the scratch image's claim: the next launch boots.checked, the store holds nothing of the launch, and a one-attemptScratchBinding::checkfinds the scratch image claimed. At the later steps, the journal records a running VMM and no runtime record exists yet. Each launch then goes on, and is stopped.step_hook.rs(new, host only): the values that set the hook and those that set none, a pause, which returns how long it paused, and the host program's status 2 for a hook that it cannot read.tests/common:Sandbox::start,finish,start_launch,finish_launch, andpaused. AStartedcommand that a failed test left paused is killed on drop, so the sandbox's drop can take the lock and end the VM.runtime_adapter::staged::Staged, preserving the upstream module split.Validation
Fresh Windows checks after rebasing:
python scripts\nvx.py verify.-D warnings, build, and tests of both protocol-only and host-only configurations (31 and 64 tests passed, respectively; the 30 hypervisor tests are intentionally ignored in the host-only gate).cargo check --locked --all-targetsof both configurations.The existing resolved review about pauses consuming the startup deadline remains
fixed: both post-spawn hooks extend the deadline by the actual pause duration.
The original author also verified 65-second pauses and the VM suites on WHP and
MSHV before this rebase; those are historical results, not fresh runs of the
rebased commit.
The fresh exact-head CI run
passed on the single folded commit
a073ecfd:and Windows/WHP.
The latest automated review of
a073ecfdrecommends approval with no openissues, and all review threads are resolved. Merge still requires the
repository's designated reviewer-team approval.
A supplemental, non-CI host-only adapter documentation check with
RUSTDOCFLAGS=-D warningsexposed pre-existing unresolvedRunnerlinks inunchanged
tests/runtime-adapter/src/exec.rs. These are outside this PR'sscope; the authoritative adapter gate does not run that extra command.