Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1352 from docker/falky_aci_start_stop
Browse files Browse the repository at this point in the history
ACI workaround invocation does not return, but container is actually running OK, trying to not block on this.
  • Loading branch information
gtardif authored Feb 26, 2021
2 parents f6354e5 + 8f2af30 commit 1118ceb
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions aci/e2e/e2e-aci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,14 @@ func TestContainerRunAttached(t *testing.T) {
time.Sleep(1 * time.Second)
c.RunDockerCmd("rm", "-f", container)
}
c.RunDockerCmd("run",
"--name", "fallback", // don't reuse the container name, this container is in a weird state and blocks everything
"--memory", "0.1G", "--cpus", "0.1",
"nginx")
go func() { // this specific call to run sometimes does not come back when in this weird state, but the container is actually running fine
c.RunDockerCmd("run",
"--name", container, // don't reuse the container name, this container is in a weird state and blocks everything
"--memory", "0.1G", "--cpus", "0.1",
"nginx")
fmt.Printf(" [%s] Finished docker run %s\n", t.Name(), container)
}()
waitForStatus(t, c, container, convert.StatusRunning)
} else {
res.Assert(t, icmd.Expected{Out: container})
waitForStatus(t, c, container, convert.StatusRunning)
Expand Down Expand Up @@ -973,7 +977,10 @@ func getContainerName(stdout string) string {

func waitForStatus(t *testing.T, c *E2eCLI, containerID string, statuses ...string) {
checkStopped := func(logt poll.LogT) poll.Result {
res := c.RunDockerCmd("inspect", containerID)
res := c.RunDockerOrExitError("inspect", containerID)
if res.Error != nil {
return poll.Continue("Error while inspecting container %s: %s", containerID, res.Combined())
}
containerInspect, err := parseContainerInspect(res.Stdout())
assert.NilError(t, err)
for _, status := range statuses {
Expand Down

0 comments on commit 1118ceb

Please sign in to comment.