smoke: smol VMs by default + JOBS auto-detects nproc

Three quality-of-life improvements now that the daemon-side races
that gated parallel mode are fixed:

1. **Smol VMs by default.** Smoke installs a tuned config.toml at
   /etc/banger/config.toml between `system install` and `system
   restart` so the respawned daemon picks up:
       vcpu = 2
       memory_mib = 1024
       disk_size = "2G"
       system_overlay_size = "2G"
   Smoke scenarios assert behavior, not capacity — they don't need
   4 vCPU / 8 GiB / 8 GiB / 8 GiB. Per-VM RAM cost drops from 8 GiB
   to 1 GiB; nominal disk drops from 16 GiB to 4 GiB (sparse, so
   actual use is small either way, but the new ceiling is gentler
   on hosts that can't overcommit). Scenarios that test
   reconfiguration (vm_set's --vcpu 2 → 4) still pass --vcpu
   explicitly, so this default doesn't perturb their assertions.

2. **JOBS defaults to nproc.** The Makefile resolves JOBS to
   `$(shell nproc)` if unset; the smoke script's existing cap of 8
   keeps the parallel pool sane on bigger hosts. The script always
   passes --jobs N now, so behavior is consistent. Override with
   `make smoke JOBS=1` for a fully serial run.

3. **Help text catches up.** --help no longer flags parallelism as
   experimental (the underlying daemon races are fixed) and now
   describes the small-VM default. `make help` mentions the new
   default and how to override.

Verified: `make smoke` (no JOBS) on a 32-core box auto-runs with
JOBS=8, smol VMs, 21/21 PASS in 172s.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Thales Maciel 2026-04-27 17:36:17 -03:00
parent 72882e45d7
commit 777b597a1e
No known key found for this signature in database
GPG key ID: 33112E6833C34679
2 changed files with 30 additions and 10 deletions

View file

@ -61,7 +61,7 @@ help:
' make tidy Run go mod tidy' \
' make clean Remove built Go binaries and coverage artefacts' \
' make smoke Build instrumented binaries, run the supported systemd smoke suite, report coverage (needs KVM + sudo)' \
' make smoke JOBS=N Same, but dispatch parallel-safe scenarios across N slots (1-8; default 1)' \
' make smoke JOBS=N Override parallelism (default: nproc, capped at 8 by the script). JOBS=1 forces serial.' \
' make smoke-list Print the list of smoke scenarios with descriptions (no build, no install)' \
' make smoke-one SCENARIO=NAME Run a single smoke scenario (still does the install preamble)' \
' make smoke-fresh smoke-clean + smoke — purges stale smoke-owned installs before a clean supported-path run' \
@ -176,13 +176,18 @@ $(SMOKE_BIN_DIR)/.built: $(BUILD_INPUTS) go.mod go.sum
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO) build -ldflags '$(GO_LDFLAGS)' -o "$(SMOKE_BIN_DIR)/banger-vsock-agent" ./cmd/banger-vsock-agent
touch "$@"
# JOBS defaults to nproc (the script caps at 8). Override with
# `make smoke JOBS=1` for a fully serial run, or any specific N for
# tighter parallelism.
JOBS ?= $(shell nproc 2>/dev/null || echo 1)
smoke: smoke-build
rm -rf "$(SMOKE_COVER_DIR)"
mkdir -p "$(SMOKE_COVER_DIR)" "$(SMOKE_XDG_DIR)"
BANGER_SMOKE_BIN_DIR="$(abspath $(SMOKE_BIN_DIR))" \
BANGER_SMOKE_COVER_DIR="$(abspath $(SMOKE_COVER_DIR))" \
BANGER_SMOKE_XDG_DIR="$(abspath $(SMOKE_XDG_DIR))" \
bash "$(SMOKE_SCRIPT)" $(if $(JOBS),--jobs $(JOBS))
bash "$(SMOKE_SCRIPT)" --jobs $(JOBS)
@echo ''
@echo 'Smoke coverage:'
@$(GO) tool covdata percent -i="$(SMOKE_COVER_DIR)"