Merge pull request #1480 from gtardif/e2e_restart_race

Removed race in e2e test
This commit is contained in:
Nicolas De loof 2021-03-30 21:19:29 +02:00 committed by GitHub
commit ad37072668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -45,8 +45,9 @@ func TestRestart(t *testing.T) {
res := c.RunDockerOrExitError("compose", "-f", "./fixtures/restart-test/compose.yml", "--project-name", projectName, "up", "-d")
assert.Assert(t, strings.Contains(res.Combined(), "Container e2e-restart_restart_1 Started"), res.Combined())
// Give the time for it to exit
time.Sleep(time.Second)
c.WaitForCmdResult(c.NewDockerCmd("compose", "--project-name", projectName, "ps", "-a", "--format", "json"),
StdoutContains(`"State":"exited"`),
10*time.Second, 1*time.Second)
res = c.RunDockerOrExitError("compose", "--project-name", projectName, "ps", "-a")
testify.Regexp(t, getServiceRegx("restart", "exited"), res.Stdout())