From 95441bb43ef1ea6d003cd3b4143bbaee70f797d6 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 23 Feb 2026 13:20:01 +0200 Subject: integrationtests: add opt-in parallel execution mode --- integrationtests/README.md | 12 ++++++++++++ integrationtests/helpers_test.go | 9 +++++++++ 2 files changed, 21 insertions(+) (limited to 'integrationtests') diff --git a/integrationtests/README.md b/integrationtests/README.md index 741d14d..8de7439 100644 --- a/integrationtests/README.md +++ b/integrationtests/README.md @@ -19,6 +19,18 @@ This builds everything (ior, ioworkload) and runs the test suite with `sudo`. Tests automatically skip with `t.Skip` when not running as root. +To opt into parallel scenario execution: + +```bash +mage integrationTestParallel +``` + +Tune parallelism by setting `INTEGRATION_PARALLEL` (default `8`), for example: + +```bash +INTEGRATION_PARALLEL=4 mage integrationTestParallel +``` + ## Structure - `cmd/ioworkload/` — Standalone binary performing known I/O patterns diff --git a/integrationtests/helpers_test.go b/integrationtests/helpers_test.go index 7db54b2..5f60f0f 100644 --- a/integrationtests/helpers_test.go +++ b/integrationtests/helpers_test.go @@ -11,6 +11,7 @@ const ( workloadBinaryDefault = "../ioworkload" bpfObjectDefault = "../ior.bpf.o" defaultDuration = 10 + parallelEnvVar = "IOR_INTEGRATION_PARALLEL" ) func newTestHarness(t *testing.T) TestHarness { @@ -48,6 +49,7 @@ func writeScript(t *testing.T, dir, name, content string) string { func runScenario(t *testing.T, scenario string, expected []ExpectedEvent) { t.Helper() + enableParallelIfRequested(t) h := newTestHarness(t) result, pid, err := h.Run(scenario, defaultDuration) if err != nil { @@ -58,3 +60,10 @@ func runScenario(t *testing.T, scenario string, expected []ExpectedEvent) { AssertNoUnexpectedComm(t, result, "ioworkload") AssertEventsPresent(t, result, expected) } + +func enableParallelIfRequested(t *testing.T) { + t.Helper() + if os.Getenv(parallelEnvVar) == "1" { + t.Parallel() + } +} -- cgit v1.2.3