From 9b02add4df656cbb175477b160a8591c943d3beb Mon Sep 17 00:00:00 2001 From: Guillaume Lours Date: Thu, 31 Mar 2022 11:16:18 +0200 Subject: [PATCH] fix race condition on start-stop e2e tests running in parrallel Signed-off-by: Guillaume Lours --- pkg/e2e/start_stop_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/e2e/start_stop_test.go b/pkg/e2e/start_stop_test.go index bcce16404..39dfdff33 100644 --- a/pkg/e2e/start_stop_test.go +++ b/pkg/e2e/start_stop_test.go @@ -27,7 +27,7 @@ import ( func TestStartStop(t *testing.T) { c := NewParallelE2eCLI(t, binDir) - const projectName = "e2e-start-stop" + const projectName = "e2e-start-stop-no-dependencies" getProjectRegx := func(status string) string { // match output with random spaces like: @@ -43,7 +43,7 @@ func TestStartStop(t *testing.T) { t.Run("Up a project", func(t *testing.T) { res := c.RunDockerComposeCmd("-f", "./fixtures/start-stop/compose.yaml", "--project-name", projectName, "up", "-d") - assert.Assert(t, strings.Contains(res.Combined(), "Container e2e-start-stop-simple-1 Started"), res.Combined()) + assert.Assert(t, strings.Contains(res.Combined(), "Container e2e-start-stop-no-dependencies-simple-1 Started"), res.Combined()) res = c.RunDockerComposeCmd("ls", "--all") testify.Regexp(t, getProjectRegx("running"), res.Stdout()) @@ -57,13 +57,13 @@ func TestStartStop(t *testing.T) { c.RunDockerComposeCmd("-f", "./fixtures/start-stop/compose.yaml", "--project-name", projectName, "stop") res := c.RunDockerComposeCmd("ls") - assert.Assert(t, !strings.Contains(res.Combined(), "e2e-start-stop"), res.Combined()) + assert.Assert(t, !strings.Contains(res.Combined(), "e2e-start-stop-no-dependencies"), res.Combined()) res = c.RunDockerComposeCmd("ls", "--all") testify.Regexp(t, getProjectRegx("exited"), res.Stdout()) res = c.RunDockerComposeCmd("--project-name", projectName, "ps") - assert.Assert(t, !strings.Contains(res.Combined(), "e2e-start-stop-words-1"), res.Combined()) + assert.Assert(t, !strings.Contains(res.Combined(), "e2e-start-stop-no-dependencies-words-1"), res.Combined()) res = c.RunDockerComposeCmd("--project-name", projectName, "ps", "--all") testify.Regexp(t, getServiceRegx("simple", "exited"), res.Stdout())