Skip to content

Commit

Permalink
Merge pull request #18074 from edsantiago/waitwait
Browse files Browse the repository at this point in the history
e2e tests: fix racy flakes
  • Loading branch information
openshift-merge-robot authored Apr 7, 2023
2 parents a616f2b + 761eca9 commit 9827f35
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/source/markdown/podman-kube-play.1.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -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.

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.

When attached in the tty mode, you can kill the pods and containers by pressing
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

Expand Down
36 changes: 36 additions & 0 deletions test/e2e/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ var _ = Describe("Podman logs", func() {
Expect(logc).To(Exit(0))
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.WaitWithDefaultTimeout()
Expect(results).To(Exit(0))
Expand All @@ -98,6 +102,10 @@ var _ = Describe("Podman logs", func() {
Expect(logc).To(Exit(0))
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.WaitWithDefaultTimeout()
Expect(results).To(Exit(0))
Expand All @@ -112,6 +120,10 @@ var _ = Describe("Podman logs", func() {
logc.WaitWithDefaultTimeout()
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.WaitWithDefaultTimeout()
Expect(results).To(Exit(0))
Expand Down Expand Up @@ -146,6 +158,10 @@ var _ = Describe("Podman logs", func() {
Expect(logc).To(Exit(0))
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.WaitWithDefaultTimeout()
Expect(results).To(Exit(0))
Expand All @@ -160,6 +176,10 @@ var _ = Describe("Podman logs", func() {
Expect(logc).To(Exit(0))
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.WaitWithDefaultTimeout()
Expect(results).To(Exit(0))
Expand All @@ -174,6 +194,10 @@ var _ = Describe("Podman logs", func() {
Expect(logc).To(Exit(0))
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.WaitWithDefaultTimeout()
Expect(results).To(Exit(0))
Expand All @@ -188,6 +212,10 @@ var _ = Describe("Podman logs", func() {
Expect(logc).To(Exit(0))
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.WaitWithDefaultTimeout()
Expect(results).To(Exit(0))
Expand All @@ -202,6 +230,10 @@ var _ = Describe("Podman logs", func() {
Expect(logc).To(Exit(0))
cid := logc.OutputToString()

wait := podmanTest.Podman([]string{"wait", cid})
wait.WaitWithDefaultTimeout()
Expect(wait).To(Exit(0))

now := time.Now()
now = now.Add(time.Minute * 1)
nowS := now.Format(time.RFC3339)
Expand Down Expand Up @@ -233,6 +265,10 @@ var _ = Describe("Podman logs", func() {
Expect(log2).Should(Exit(0))
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.WaitWithDefaultTimeout()
Expect(results).Should(Exit(0))
Expand Down
5 changes: 5 additions & 0 deletions test/e2e/play_kube_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2021,6 +2021,11 @@ var _ = Describe("Podman play kube", func() {
kube.WaitWithDefaultTimeout()
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.WaitWithDefaultTimeout()
Expect(logs).Should(Exit(0))
Expand Down

0 comments on commit 9827f35

Please sign in to comment.