Skip to content

refactor: parallel test infra + nextest simplification + boot timing#286

Merged
DorianZheng merged 2 commits intomainfrom
refactor/parallel-test-infra
Feb 22, 2026
Merged

refactor: parallel test infra + nextest simplification + boot timing#286
DorianZheng merged 2 commits intomainfrom
refactor/parallel-test-infra

Conversation

@DorianZheng
Copy link
Copy Markdown
Member

Summary

  • Parallel test isolation: WarmRuntimeParallelRuntime with per-test TempDir + symlinked image cache, enabling concurrent VM test execution
  • Nextest simplification: 6 test groups → 1 (serial-cli only has a real constraint); removes no-op groups and redundant overrides (124 → 43 lines)
  • CI modernization: cargo testcargo nextest + cargo-llvm-cov coverage with Codecov upload
  • Property-based tests: proptest added to boxlite-shared (layout paths) and boxlite (BoxID validation)
  • Boot timing instrumentation: eprintln! timing in shim, krun context, and guest agent for diagnosing boot latency
  • Timing profile test: New timing_profile.rs (ignored, manual diagnostic)
  • Boot latency analysis doc: New docs/development/boot-latency-analysis.md

Files changed (19 modified + 2 new)

Area Files
Nextest config .config/nextest.toml
CI .github/workflows/test.yml
Dependencies Cargo.lock, boxlite-shared/Cargo.toml, boxlite/Cargo.toml
Property tests boxlite-shared/src/layout.rs, boxlite/src/runtime/id.rs
Boot timing boxlite/src/bin/shim/main.rs, boxlite/src/vmm/krun/context.rs, guest/src/main.rs, guest/src/service/server.rs
Test infra boxlite/tests/common/mod.rs
Test migrations boxlite/tests/{clone_export_import,execution_shutdown,jailer,lifecycle,pid_file,sigstop_quiesce}.rs
New files boxlite/tests/timing_profile.rs, docs/development/boot-latency-analysis.md
Docs boxlite/tests/README.md

Test plan

  • cargo fmt --check — passes
  • cargo clippy -p boxlite -p boxlite-shared --tests -- -D warnings — passes
  • cargo nextest run -p boxlite-shared --lib — 7 tests pass (proptest)
  • cargo nextest run -p boxlite --lib — 494 tests pass
  • CI workflow runs with nextest + coverage

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
@DorianZheng DorianZheng merged commit e4eecf1 into main Feb 22, 2026
14 checks passed
@DorianZheng DorianZheng deleted the refactor/parallel-test-infra branch February 22, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant