summaryrefslogtreecommitdiff
path: root/integrationtests/helpers_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'integrationtests/helpers_test.go')
-rw-r--r--integrationtests/helpers_test.go9
1 files changed, 9 insertions, 0 deletions
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()
+ }
+}