summaryrefslogtreecommitdiff
path: root/integrationtests
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-23 13:20:01 +0200
committerPaul Buetow <paul@buetow.org>2026-02-23 13:20:01 +0200
commit95441bb43ef1ea6d003cd3b4143bbaee70f797d6 (patch)
tree55890376bb0081264249bead577c425ffba009df /integrationtests
parent425d725048ee2f6225a093db719ced0fab54cdbc (diff)
integrationtests: add opt-in parallel execution mode
Diffstat (limited to 'integrationtests')
-rw-r--r--integrationtests/README.md12
-rw-r--r--integrationtests/helpers_test.go9
2 files changed, 21 insertions, 0 deletions
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()
+ }
+}