Merge pull request #18074 from edsantiago/waitwait

e2e tests: fix racy flakes
This commit is contained in:
OpenShift Merge Robot
2023-04-07 05:50:22 -04:00
committed by GitHub
3 changed files with 44 additions and 2 deletions

View File

@ -244,13 +244,14 @@ Start the pod after creating it, set to false to only create it.
Run pods and containers in the foreground. Default is false. Run pods and containers in the foreground. Default is false.
At any time you can run `podman pod ps` in the other shell to view a list of At any time you can run `podman pod ps` in another shell to view a list of
the running pods and containers. the running pods and containers.
When attached in the tty mode, you can kill the pods and containers by pressing When attached in the tty mode, you can kill the pods and containers by pressing
Ctrl-C or receiving any other interrupt signals. Ctrl-C or receiving any other interrupt signals.
Volumes created with `podman kube play` will be removed when `--wait=true`. All pods, containers, and volumes created with `podman kube play` will be removed
upon exit.
## EXAMPLES ## EXAMPLES

View File

@ -84,6 +84,10 @@ var _ = Describe("Podman logs", func() {
Expect(logc).To(Exit(0)) Expect(logc).To(Exit(0))
cid := logc.OutputToString() cid := logc.OutputToString()
wait := podmanTest.Podman([]string{"wait", cid})
wait.WaitWithDefaultTimeout()
Expect(wait).To(Exit(0))
results := podmanTest.Podman([]string{"logs", "--tail", "2", cid}) results := podmanTest.Podman([]string{"logs", "--tail", "2", cid})
results.WaitWithDefaultTimeout() results.WaitWithDefaultTimeout()
Expect(results).To(Exit(0)) Expect(results).To(Exit(0))
@ -98,6 +102,10 @@ var _ = Describe("Podman logs", func() {
Expect(logc).To(Exit(0)) Expect(logc).To(Exit(0))
cid := logc.OutputToString() cid := logc.OutputToString()
wait := podmanTest.Podman([]string{"wait", cid})
wait.WaitWithDefaultTimeout()
Expect(wait).To(Exit(0))
results := podmanTest.Podman([]string{"logs", "--tail", "0", cid}) results := podmanTest.Podman([]string{"logs", "--tail", "0", cid})
results.WaitWithDefaultTimeout() results.WaitWithDefaultTimeout()
Expect(results).To(Exit(0)) Expect(results).To(Exit(0))
@ -112,6 +120,10 @@ var _ = Describe("Podman logs", func() {
logc.WaitWithDefaultTimeout() logc.WaitWithDefaultTimeout()
Expect(logc).To(Exit(0)) Expect(logc).To(Exit(0))
wait := podmanTest.Podman([]string{"wait", name})
wait.WaitWithDefaultTimeout()
Expect(wait).To(Exit(0))
results := podmanTest.Podman([]string{"logs", "--tail", "99", name}) results := podmanTest.Podman([]string{"logs", "--tail", "99", name})
results.WaitWithDefaultTimeout() results.WaitWithDefaultTimeout()
Expect(results).To(Exit(0)) Expect(results).To(Exit(0))
@ -146,6 +158,10 @@ var _ = Describe("Podman logs", func() {
Expect(logc).To(Exit(0)) Expect(logc).To(Exit(0))
cid := logc.OutputToString() cid := logc.OutputToString()
wait := podmanTest.Podman([]string{"wait", cid})
wait.WaitWithDefaultTimeout()
Expect(wait).To(Exit(0))
results := podmanTest.Podman([]string{"logs", "--tail", "2", "-t", cid}) results := podmanTest.Podman([]string{"logs", "--tail", "2", "-t", cid})
results.WaitWithDefaultTimeout() results.WaitWithDefaultTimeout()
Expect(results).To(Exit(0)) Expect(results).To(Exit(0))
@ -160,6 +176,10 @@ var _ = Describe("Podman logs", func() {
Expect(logc).To(Exit(0)) Expect(logc).To(Exit(0))
cid := logc.OutputToString() cid := logc.OutputToString()
wait := podmanTest.Podman([]string{"wait", cid})
wait.WaitWithDefaultTimeout()
Expect(wait).To(Exit(0))
results := podmanTest.Podman([]string{"logs", "--since", "2017-08-07T10:10:09.056611202-04:00", cid}) results := podmanTest.Podman([]string{"logs", "--since", "2017-08-07T10:10:09.056611202-04:00", cid})
results.WaitWithDefaultTimeout() results.WaitWithDefaultTimeout()
Expect(results).To(Exit(0)) Expect(results).To(Exit(0))
@ -174,6 +194,10 @@ var _ = Describe("Podman logs", func() {
Expect(logc).To(Exit(0)) Expect(logc).To(Exit(0))
cid := logc.OutputToString() cid := logc.OutputToString()
wait := podmanTest.Podman([]string{"wait", cid})
wait.WaitWithDefaultTimeout()
Expect(wait).To(Exit(0))
results := podmanTest.Podman([]string{"logs", "--since", "10m", cid}) results := podmanTest.Podman([]string{"logs", "--since", "10m", cid})
results.WaitWithDefaultTimeout() results.WaitWithDefaultTimeout()
Expect(results).To(Exit(0)) Expect(results).To(Exit(0))
@ -188,6 +212,10 @@ var _ = Describe("Podman logs", func() {
Expect(logc).To(Exit(0)) Expect(logc).To(Exit(0))
cid := logc.OutputToString() cid := logc.OutputToString()
wait := podmanTest.Podman([]string{"wait", cid})
wait.WaitWithDefaultTimeout()
Expect(wait).To(Exit(0))
results := podmanTest.Podman([]string{"logs", "--until", "10m", cid}) results := podmanTest.Podman([]string{"logs", "--until", "10m", cid})
results.WaitWithDefaultTimeout() results.WaitWithDefaultTimeout()
Expect(results).To(Exit(0)) Expect(results).To(Exit(0))
@ -202,6 +230,10 @@ var _ = Describe("Podman logs", func() {
Expect(logc).To(Exit(0)) Expect(logc).To(Exit(0))
cid := logc.OutputToString() cid := logc.OutputToString()
wait := podmanTest.Podman([]string{"wait", cid})
wait.WaitWithDefaultTimeout()
Expect(wait).To(Exit(0))
now := time.Now() now := time.Now()
now = now.Add(time.Minute * 1) now = now.Add(time.Minute * 1)
nowS := now.Format(time.RFC3339) nowS := now.Format(time.RFC3339)
@ -233,6 +265,10 @@ var _ = Describe("Podman logs", func() {
Expect(log2).Should(Exit(0)) Expect(log2).Should(Exit(0))
cid2 := log2.OutputToString() cid2 := log2.OutputToString()
wait := podmanTest.Podman([]string{"wait", cid1, cid2})
wait.WaitWithDefaultTimeout()
Expect(wait).To(Exit(0))
results := podmanTest.Podman([]string{"logs", cid1, cid2}) results := podmanTest.Podman([]string{"logs", cid1, cid2})
results.WaitWithDefaultTimeout() results.WaitWithDefaultTimeout()
Expect(results).Should(Exit(0)) Expect(results).Should(Exit(0))

View File

@ -2021,6 +2021,11 @@ var _ = Describe("Podman play kube", func() {
kube.WaitWithDefaultTimeout() kube.WaitWithDefaultTimeout()
Expect(kube).Should(Exit(0)) Expect(kube).Should(Exit(0))
wait := podmanTest.Podman([]string{"wait", "test-symlink-test-symlink"})
wait.WaitWithDefaultTimeout()
Expect(wait).Should(Exit(0))
Expect(wait.OutputToString()).To(Equal("0"))
logs := podmanTest.Podman([]string{"pod", "logs", "-c", "test-symlink-test-symlink", "test-symlink"}) logs := podmanTest.Podman([]string{"pod", "logs", "-c", "test-symlink-test-symlink", "test-symlink"})
logs.WaitWithDefaultTimeout() logs.WaitWithDefaultTimeout()
Expect(logs).Should(Exit(0)) Expect(logs).Should(Exit(0))