Skip to content

4. Real suite

4. Real suite

Result: works. meristem's 128 unit tests pass under gVisor on smaug, with packages downloaded from inside the sandbox. gVisor adds about 15% to test time; smaug itself is about 1.8× slower than the laptop for this suite.

Setup (2026-11-22)

  • Image ghcr.io/astral-sh/uv:0.12.0-python3.14-trixie-slim (matches the repo's pinned uv 0.12.0). uv downloaded CPython 3.14.3 per .python-version.
  • Source: a fresh copy of the experiment 3 checkout for every run, so each run builds its own .venv.
  • uv cache on a host directory mounted at /uvcache (UV_CACHE_DIR=/uvcache, UV_LINK_MODE=copy), emptied before the cold run.
  • Command, from meristem/ (same as its test-unit recipe): uv run pytest -q -m "not real_spanner" tests --ignore=tests/integration
  • gVisor runs: podman --runtime …/runsc --runtime-flag ignore-cgroups run --rm … with Podman's default rootless networking.
  • Laptop baseline: a temporary worktree at the same commit (ea646ec6b), laptop's own uv cache.

Raw results

Run Wall clock pytest's own time
smaug, runsc, empty cache 14.4 s 5.90 s
smaug, runsc, warm cache 10.7 s, 10.8 s 6.03 s, 5.92 s
smaug, crun, warm cache 9.1 s, 8.4 s 5.31 s, 5.03 s
laptop, first run (new .venv) 7.65 s 6.34 s
laptop, warm 3.16 s 2.90 s

All runs: 128 passed, 1 warning. The warning is identical on the laptop (see below), so the sandbox didn't introduce it.

What we learned

  • A real Python suite runs unchanged under gVisor, including uv's downloads over Podman's rootless network from inside the sandbox.
  • gVisor's cost on real tests is modest: about 15% on pytest time (5.9–6.0 s vs 5.0–5.3 s), much less than the 3× worst case from experiment 2.
  • Environment setup is a large share of a short job. About 4.5–5 s of each warm runsc run is outside pytest, mostly uv building a fresh .venv by copying from the cache. For short suites, a runner that reuses a per-repo .venv (or a faster link mode) would save more than any sandbox tuning.
  • smaug is slower per job than the laptop (5.0 s vs 2.9 s of pytest time on crun). Offloading wins on parallelism and on freeing the laptop, not on single-job latency.
  • Existing Transpire issue, not ours: meristem's test output isn't clean. Every run, laptop included, prints SAWarning: Can't validate argument 'spanner_allow_commit_timestamp'; can't locate any SQLAlchemy dialect named 'spanner' from src/meristem/columns.py:143.

What it changes

  • The runner design should keep a warm per-repo environment, not only a package cache. Copy-on-write reuse keeps jobs isolated.
  • Scheduling should prefer the laptop for one quick job and runners for many in parallel. That's a client-side policy, not a core change.