aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-06-17 17:06:16 +0200
committerGitHub <noreply@github.com>2020-06-17 17:06:16 +0200
commit1acd2adccb357c317add19cea8f0daea328e8315 (patch)
tree3509dca3161dbb129fb7eb3ebaf1e5d88e646dec
parent78ad57ebd35acac59ffa6c7b8231ffaf9e0c1f7a (diff)
parent6d5a432c2e6e538308961b9c130c3aeb32138c7b (diff)
downloadpodman-1acd2adccb357c317add19cea8f0daea328e8315.tar.gz
podman-1acd2adccb357c317add19cea8f0daea328e8315.tar.bz2
podman-1acd2adccb357c317add19cea8f0daea328e8315.zip
Merge pull request #6640 from edsantiago/fix_flaky_logs_test
"streaming output" logs test: fix flake
-rw-r--r--test/e2e/logs_test.go20
1 files changed, 16 insertions, 4 deletions
diff --git a/test/e2e/logs_test.go b/test/e2e/logs_test.go
index f9446e0c6..5d8ce24e9 100644
--- a/test/e2e/logs_test.go
+++ b/test/e2e/logs_test.go
@@ -283,10 +283,22 @@ var _ = Describe("Podman logs", func() {
results.WaitWithDefaultTimeout()
Expect(results).To(Exit(0))
- // Verify that the cleanup process worked correctly and we can recreate a container with the same name
- logc = podmanTest.Podman([]string{"run", "--rm", "--name", containerName, "-dt", ALPINE, "true"})
- logc.WaitWithDefaultTimeout()
- Expect(logc).To(Exit(0))
+ // TODO: we should actually check for two podman lines,
+ // but as of 2020-06-17 there's a race condition in which
+ // 'logs -f' may not catch all output from a container
+ Expect(results.OutputToString()).To(ContainSubstring("podman"))
+
+ // Container should now be terminatING or terminatED, but we
+ // have no guarantee of which: 'logs -f' does not necessarily
+ // wait for cleanup. Run 'inspect' and accept either state.
+ inspect := podmanTest.Podman([]string{"container", "inspect", "--format", "{{.State.Status}}", containerName})
+ inspect.WaitWithDefaultTimeout()
+ if inspect.ExitCode() == 0 {
+ Expect(inspect.OutputToString()).To(Equal("exited"))
+ // TODO: add 2-second wait loop to confirm cleanup
+ } else {
+ Expect(inspect.ErrorToString()).To(ContainSubstring("no such container"))
+ }
})
It("follow output stopped container", func() {