mirror of
https://github.com/docker/compose.git
synced 2025-07-24 22:24:41 +02:00
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.
This commit is contained in:
commit
1118cebc02
@ -485,10 +485,14 @@ func TestContainerRunAttached(t *testing.T) {
|
|||||||
time.Sleep(1 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
c.RunDockerCmd("rm", "-f", container)
|
c.RunDockerCmd("rm", "-f", container)
|
||||||
}
|
}
|
||||||
c.RunDockerCmd("run",
|
go func() { // this specific call to run sometimes does not come back when in this weird state, but the container is actually running fine
|
||||||
"--name", "fallback", // don't reuse the container name, this container is in a weird state and blocks everything
|
c.RunDockerCmd("run",
|
||||||
"--memory", "0.1G", "--cpus", "0.1",
|
"--name", container, // don't reuse the container name, this container is in a weird state and blocks everything
|
||||||
"nginx")
|
"--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 {
|
} else {
|
||||||
res.Assert(t, icmd.Expected{Out: container})
|
res.Assert(t, icmd.Expected{Out: container})
|
||||||
waitForStatus(t, c, container, convert.StatusRunning)
|
waitForStatus(t, c, container, convert.StatusRunning)
|
||||||
@ -973,7 +977,10 @@ func getContainerName(stdout string) string {
|
|||||||
|
|
||||||
func waitForStatus(t *testing.T, c *E2eCLI, containerID string, statuses ...string) {
|
func waitForStatus(t *testing.T, c *E2eCLI, containerID string, statuses ...string) {
|
||||||
checkStopped := func(logt poll.LogT) poll.Result {
|
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())
|
containerInspect, err := parseContainerInspect(res.Stdout())
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
for _, status := range statuses {
|
for _, status := range statuses {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user