diff options
author | Paul Holzinger <pholzing@redhat.com> | 2021-09-22 16:11:50 +0200 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2021-09-22 16:36:31 -0400 |
commit | 909cbfe217204ef6beceea9f6983974338d524e1 (patch) | |
tree | 1093c76d7f0f8e55c9eea3d58bbad4baafa8272e /test/e2e | |
parent | 8971509468de9d914314a1c77b445e118300eb0e (diff) | |
download | podman-909cbfe217204ef6beceea9f6983974338d524e1.tar.gz podman-909cbfe217204ef6beceea9f6983974338d524e1.tar.bz2 podman-909cbfe217204ef6beceea9f6983974338d524e1.zip |
sync container state before reading the healthcheck
The health check result is stored in the container state. Since the
state can change or might not even be set we have to retrive the current
state before we try to read the health check result.
Fixes #11687
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/healthcheck_run_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/e2e/healthcheck_run_test.go b/test/e2e/healthcheck_run_test.go index 87f042ed9..1445a634b 100644 --- a/test/e2e/healthcheck_run_test.go +++ b/test/e2e/healthcheck_run_test.go @@ -214,5 +214,12 @@ var _ = Describe("Podman healthcheck run", func() { inspect = podmanTest.InspectContainer("hc") Expect(inspect[0].State.Healthcheck.Status).To(Equal(define.HealthCheckHealthy)) + + // Test podman ps --filter heath is working (#11687) + ps := podmanTest.Podman([]string{"ps", "--filter", "health=healthy"}) + ps.WaitWithDefaultTimeout() + Expect(ps).Should(Exit(0)) + Expect(len(ps.OutputToStringArray())).To(Equal(2)) + Expect(ps.OutputToString()).To(ContainSubstring("hc")) }) }) |