From 4dd1918ac2203b0756dbf236e46459b42a0188aa Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Wed, 5 Aug 2020 13:59:03 +0200 Subject: [PATCH] Improve test that was sometimes passing too quickly where it should fail --- tests/skip-win-ci-e2e/skip_win_ci_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/skip-win-ci-e2e/skip_win_ci_test.go b/tests/skip-win-ci-e2e/skip_win_ci_test.go index b8de44377..0bb5ce31b 100644 --- a/tests/skip-win-ci-e2e/skip_win_ci_test.go +++ b/tests/skip-win-ci-e2e/skip_win_ci_test.go @@ -24,6 +24,8 @@ import ( "testing" "time" + "github.com/docker/api/cli/mobycli" + . "github.com/onsi/gomega" "github.com/stretchr/testify/suite" @@ -50,9 +52,10 @@ RUN sleep 100`), 0644)).To(Succeed()) _, err := ctx.Exec() errs <- err }() + mobyBuild := mobycli.ComDockerCli + " build --no-cache -t " + imageName err := WaitFor(time.Second, 10*time.Second, errs, func() bool { out := s.ListProcessesCommand().ExecOrDie() - return strings.Contains(out, imageName) + return strings.Contains(out, mobyBuild) }) Expect(err).NotTo(HaveOccurred()) log.Println("Killing docker process") @@ -60,7 +63,7 @@ RUN sleep 100`), 0644)).To(Succeed()) close(shutdown) err = WaitFor(time.Second, 12*time.Second, nil, func() bool { out := s.ListProcessesCommand().ExecOrDie() - return !strings.Contains(out, imageName) + return !strings.Contains(out, mobyBuild) }) Expect(err).NotTo(HaveOccurred()) })