summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-05-25 09:42:57 -0700
committerGitHub <noreply@github.com>2021-05-25 09:42:57 -0700
commit8f71881a63b5b5422efe523d10d360650ecf9c67 (patch)
tree8e8a5419ccf5c3cdbfbbf75361828509aa683622
parentd0f5796c3975dea3e26e0f50d8111d4be6d5a963 (diff)
parente6a3d6aaccecb86baf9cf3f0788bd1c8497820df (diff)
downloadpodman-8f71881a63b5b5422efe523d10d360650ecf9c67.tar.gz
podman-8f71881a63b5b5422efe523d10d360650ecf9c67.tar.bz2
podman-8f71881a63b5b5422efe523d10d360650ecf9c67.zip
Merge pull request #10456 from rhatdan/flake1
Fix race on podman start --all
-rw-r--r--test/e2e/common_test.go18
-rw-r--r--test/system/045-start.bats2
2 files changed, 18 insertions, 2 deletions
diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go
index 359345096..7ffee961c 100644
--- a/test/e2e/common_test.go
+++ b/test/e2e/common_test.go
@@ -408,7 +408,14 @@ func (p *PodmanTestIntegration) RunLsContainer(name string) (*PodmanSessionInteg
podmanArgs = append(podmanArgs, "-d", ALPINE, "ls")
session := p.Podman(podmanArgs)
session.WaitWithDefaultTimeout()
- return session, session.ExitCode(), session.OutputToString()
+ if session.ExitCode() != 0 {
+ return session, session.ExitCode(), session.OutputToString()
+ }
+ cid := session.OutputToString()
+
+ wsession := p.Podman([]string{"wait", cid})
+ wsession.WaitWithDefaultTimeout()
+ return session, wsession.ExitCode(), cid
}
// RunNginxWithHealthCheck runs the alpine nginx container with an optional name and adds a healthcheck into it
@@ -431,7 +438,14 @@ func (p *PodmanTestIntegration) RunLsContainerInPod(name, pod string) (*PodmanSe
podmanArgs = append(podmanArgs, "-d", ALPINE, "ls")
session := p.Podman(podmanArgs)
session.WaitWithDefaultTimeout()
- return session, session.ExitCode(), session.OutputToString()
+ if session.ExitCode() != 0 {
+ return session, session.ExitCode(), session.OutputToString()
+ }
+ cid := session.OutputToString()
+
+ wsession := p.Podman([]string{"wait", cid})
+ wsession.WaitWithDefaultTimeout()
+ return session, wsession.ExitCode(), cid
}
// BuildImage uses podman build and buildah to build an image
diff --git a/test/system/045-start.bats b/test/system/045-start.bats
index 542f9d1c2..3e0118dba 100644
--- a/test/system/045-start.bats
+++ b/test/system/045-start.bats
@@ -25,6 +25,8 @@ load helpers
die "podman start --all restarted a running container"
fi
+ run_podman wait $cid_none_implicit $cid_none_explicit $cid_on_failure
+
run_podman rm $cid_none_implicit $cid_none_explicit $cid_on_failure
run_podman stop -t 1 $cid_always
run_podman rm $cid_always