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

Commit 1118ceb

Browse files
authored
Merge pull request #1352 from docker/falky_aci_start_stop
ACI workaround invocation does not return, but container is actually running OK, trying to not block on this.
2 parents f6354e5 + 8f2af30 commit 1118ceb

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

aci/e2e/e2e-aci_test.go

+12-5
Original file line numberDiff line numberDiff line change
@@ -485,10 +485,14 @@ func TestContainerRunAttached(t *testing.T) {
485485
time.Sleep(1 * time.Second)
486486
c.RunDockerCmd("rm", "-f", container)
487487
}
488-
c.RunDockerCmd("run",
489-
"--name", "fallback", // don't reuse the container name, this container is in a weird state and blocks everything
490-
"--memory", "0.1G", "--cpus", "0.1",
491-
"nginx")
488+
go func() { // this specific call to run sometimes does not come back when in this weird state, but the container is actually running fine
489+
c.RunDockerCmd("run",
490+
"--name", container, // don't reuse the container name, this container is in a weird state and blocks everything
491+
"--memory", "0.1G", "--cpus", "0.1",
492+
"nginx")
493+
fmt.Printf(" [%s] Finished docker run %s\n", t.Name(), container)
494+
}()
495+
waitForStatus(t, c, container, convert.StatusRunning)
492496
} else {
493497
res.Assert(t, icmd.Expected{Out: container})
494498
waitForStatus(t, c, container, convert.StatusRunning)
@@ -973,7 +977,10 @@ func getContainerName(stdout string) string {
973977

974978
func waitForStatus(t *testing.T, c *E2eCLI, containerID string, statuses ...string) {
975979
checkStopped := func(logt poll.LogT) poll.Result {
976-
res := c.RunDockerCmd("inspect", containerID)
980+
res := c.RunDockerOrExitError("inspect", containerID)
981+
if res.Error != nil {
982+
return poll.Continue("Error while inspecting container %s: %s", containerID, res.Combined())
983+
}
977984
containerInspect, err := parseContainerInspect(res.Stdout())
978985
assert.NilError(t, err)
979986
for _, status := range statuses {

0 commit comments

Comments
 (0)