diff --git a/internal/init_test.go b/internal/init_test.go index 25bfc19da..839d8185d 100644 --- a/internal/init_test.go +++ b/internal/init_test.go @@ -39,7 +39,6 @@ func TestAccBundleInitErrorOnUnknownFields(t *testing.T) { // make changes that can break the MLOps Stacks DAB. In which case we should // skip this test until the MLOps Stacks DAB is updated to work again. func TestAccBundleInitOnMlopsStacks(t *testing.T) { - t.Parallel() env := testutil.GetCloud(t).String() tmpDir1 := t.TempDir() diff --git a/internal/testutil/env.go b/internal/testutil/env.go index e1973ba82..7a7436f47 100644 --- a/internal/testutil/env.go +++ b/internal/testutil/env.go @@ -51,6 +51,10 @@ func GetEnvOrSkipTest(t *testing.T, name string) string { // Changes into specified directory for the duration of the test. // Returns the current working directory. func Chdir(t *testing.T, dir string) string { + // Prevent parallel execution when changing the working directory. + // t.Setenv automatically fails if t.Parallel is set. + t.Setenv("DO_NOT_RUN_IN_PARALLEL", "true") + wd, err := os.Getwd() require.NoError(t, err)