Skip to content

Run test configs on parallel stacks, two slots by default - #282

Merged
SiteRelEnby merged 1 commit into
mainfrom
ci/parallel-run-tests
Sep 9, 2026
Merged

SiteRelEnby merged 1 commit into
mainfrom
ci/parallel-run-tests

Conversation

@SiteRelEnby

Copy link
Copy Markdown
Contributor

Local-dev quality of life: run_tests.sh now spreads the eleven configs across parallel stacks, two slots by default - conservative for any dev box but still roughly halving a full pass. --jobs N widens it, --jobs 1 forces the classic serial path (byte-identical output, banners included), and single-config runs clamp to one slot, so CI's per-config matrix jobs are untouched.

Isolation comes from per-slot compose projects (sheaf-test-<s>) with offset port triplets: each slot has its own postgres, redis, app, volumes, and network, and slot 1 keeps the serial defaults (8001/5433/6380). The image builds once before slots fork; per-config output is captured and replayed serially in canonical order so nothing interleaves; the machine-wide flock still covers the whole run; slot traps tear down their own stacks with a master trap for interrupt cleanup. selfhosted/none dominates wall clock and gets slot 1 to itself.

The test compose interpolates its host ports and SHEAF_BASE_URL from SHEAF_TEST_*_PORT (defaults unchanged) and pins the image tag the serial build already produces. Parallel verification flushed out one real coupling: the import-runner test helpers hardcoded the sheaf-test compose project for their docker exec and now honour SHEAF_TEST_COMPOSE_PROJECT (default unchanged, so direct pytest use and CI need nothing).

Verified live: the no-flag default ran two concurrent stacks to green (both project prefixes in docker ps, zero container/volume residue after teardown), explicit --jobs 2 likewise, and --jobs 1 matches serial output exactly. Incidental fixes: all eleven banners carry the mode suffix (previously four did), and duplicate config args dedupe instead of miscounting the progress prefix.

Remaining soak: one timed full pass of all eleven configs to size headroom before habitually widening past two.

Configs ran serially, so a full local pass cost the sum of all eleven;
they now partition across isolated stacks and cost roughly the largest
slot. Each slot gets its own compose project (sheaf-test-<s>) and port
triplet, so databases, volumes, and networks never overlap; slot 1 uses
the exact serial defaults. Two slots by default - conservative for any
dev box but still roughly halves a full pass; --jobs N widens, --jobs 1
forces the classic serial path (byte-identical output, banners
included), and single-config runs (CI's shape) clamp to one slot so the
Actions matrix is untouched.

The image builds once before slots fork, per-config output is captured
and replayed serially in canonical order, the machine-wide flock still
covers the whole run, and slot traps tear down their own stacks with a
master trap for interrupt cleanup. selfhosted/none dominates wall clock
and gets slot 1 alone. The test compose interpolates host ports and
SHEAF_BASE_URL from SHEAF_TEST_*_PORT (defaults unchanged) and pins the
image tag the serial build already produced. Parallel verification
flushed out one real coupling: the import-runner test helpers hardcoded
the sheaf-test compose project for docker exec and now honour
SHEAF_TEST_COMPOSE_PROJECT (default unchanged).

Verified live: the default two-slot path and explicit --jobs 2 both ran
concurrent stacks to green with clean teardown; --jobs 1 matches serial
exactly.
@SiteRelEnby
SiteRelEnby merged commit 782191b into main Sep 9, 2026
18 checks passed
@SiteRelEnby
SiteRelEnby deleted the ci/parallel-run-tests branch September 9, 2026 23:01
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