refactor: parallel test infra + nextest simplification + boot timing#286
Merged
DorianZheng merged 2 commits intomainfrom Feb 22, 2026
Merged
refactor: parallel test infra + nextest simplification + boot timing#286DorianZheng merged 2 commits intomainfrom
DorianZheng merged 2 commits intomainfrom
Conversation
Eliminate ~400 lines of duplicated test boilerplate across 7 integration test files by introducing a shared `common/mod.rs` module with: - `WarmRuntime`: shared image cache at /tmp/boxlite-test/ for VM tests - `IsolatedRuntime`: per-test TempDir for non-VM tests (parallel-safe) - `alpine_opts()` / `alpine_opts_auto()`: replaces ~55 inline BoxOptions Nextest config updated with granular binary-level test groups: - Non-VM tests (runtime, shutdown, network) → parallel (max-threads=4) - VM tests → serial (max-threads=1) - CLI completion tests → parallel (max-threads=num-cpus) Makefile gains `test:warm-cache` target to pre-pull alpine:latest, wired as a dependency of `test:integration`. Execution_shutdown.rs sleeps reduced from 500ms to 50ms (saves ~3.6s).
- WarmRuntime → ParallelRuntime with per-test TempDir and symlinked image cache, enabling concurrent VM test execution - Simplify nextest config from 6 test groups to 1 (serial-cli only) - Add cargo-nextest + cargo-llvm-cov coverage with Codecov upload to CI - Add proptest property-based tests for BoxID and layout paths - Add boot timing instrumentation (shim, krun context, guest agent) - Add timing_profile.rs diagnostic test and boot latency analysis doc
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.
Summary
WarmRuntime→ParallelRuntimewith per-testTempDir+ symlinked image cache, enabling concurrent VM test executionserial-clionly has a real constraint); removes no-op groups and redundant overrides (124 → 43 lines)cargo test→cargo nextest+cargo-llvm-covcoverage with Codecov uploadproptestadded toboxlite-shared(layout paths) andboxlite(BoxID validation)eprintln!timing in shim, krun context, and guest agent for diagnosing boot latencytiming_profile.rs(ignored, manual diagnostic)docs/development/boot-latency-analysis.mdFiles changed (19 modified + 2 new)
.config/nextest.toml.github/workflows/test.ymlCargo.lock,boxlite-shared/Cargo.toml,boxlite/Cargo.tomlboxlite-shared/src/layout.rs,boxlite/src/runtime/id.rsboxlite/src/bin/shim/main.rs,boxlite/src/vmm/krun/context.rs,guest/src/main.rs,guest/src/service/server.rsboxlite/tests/common/mod.rsboxlite/tests/{clone_export_import,execution_shutdown,jailer,lifecycle,pid_file,sigstop_quiesce}.rsboxlite/tests/timing_profile.rs,docs/development/boot-latency-analysis.mdboxlite/tests/README.mdTest plan
cargo fmt --check— passescargo clippy -p boxlite -p boxlite-shared --tests -- -D warnings— passescargo nextest run -p boxlite-shared --lib— 7 tests pass (proptest)cargo nextest run -p boxlite --lib— 494 tests pass