From ff36ee6e0e0af8af45e3eab89a63261a7fd5d898 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Thu, 3 Feb 2022 21:58:52 +0200 Subject: [PATCH] test/cgroups.bats: fix incorrect setup order. Don't dereference $TESTDATA before the test case is set up. Doing otherwise breaks proper isolation of test cases. This manifests itself in many ways, since concurrently cgroups BATS tests can now interfere with each other when mangling test input data. The most typical symptom is the expected memory limit being incorrect in one of the test cases like this: not ok 14 cgroupv2 unified support # (in test file ./cgroups.bats, line 103) # `[[ "$output" == *"209715200"* ]]' failed Signed-off-by: Krisztian Litkey --- test/cgroups.bats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cgroups.bats b/test/cgroups.bats index 99ae3469043..6d45506041f 100644 --- a/test/cgroups.bats +++ b/test/cgroups.bats @@ -3,8 +3,8 @@ load helpers function setup() { - newconfig="$TESTDIR/config.json" setup_test + newconfig="$TESTDIR/config.json" } function teardown() {