From b050cb8a809e5e65d51c1f2ace387fbdd2d017b7 Mon Sep 17 00:00:00 2001 From: Aryanbhargava18 Date: Wed, 29 Jul 2026 20:12:56 +0530 Subject: [PATCH] test/e2e: fix and re-enable healthcheck run test flake The 'podman healthcheck on valid container' test was skipped since 2019 due to a consistent flake. The root cause was a brittle manual 5-second polling loop that failed on heavily loaded CI runners before the healthcheck daemon could initialize. This commit modernizes the polling logic by replacing the manual loop with Ginkgo's robust Eventually block with a 30-second timeout, allowing the test to run reliably on all environments, and removes the Skip directive. Signed-off-by: Aryanbhargava18 --- test/e2e/healthcheck_run_test.go | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/test/e2e/healthcheck_run_test.go b/test/e2e/healthcheck_run_test.go index 673998cce9..2e350d977a 100644 --- a/test/e2e/healthcheck_run_test.go +++ b/test/e2e/healthcheck_run_test.go @@ -103,24 +103,17 @@ var _ = Describe("Podman healthcheck run", func() { }) It("podman healthcheck on valid container", func() { - Skip("Extremely consistent flake - re-enable on debugging") + SkipIfNotAMD64() // https://github.com/containers/podman/issues/28269 session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", HEALTHCHECK_IMAGE}) session.WaitWithDefaultTimeout() Expect(session).Should(ExitCleanly()) - exitCode := 999 - // Buy a little time to get container running - for i := range 5 { + Eventually(func() int { hc := podmanTest.Podman([]string{"healthcheck", "run", "hc"}) hc.WaitWithDefaultTimeout() - exitCode = hc.ExitCode() - if exitCode == 0 || i == 4 { - break - } - time.Sleep(1 * time.Second) - } - Expect(exitCode).To(Equal(0)) + return hc.ExitCode() + }, 30*time.Second, 1*time.Second).Should(Equal(0)) ps := podmanTest.Podman([]string{"ps"}) ps.WaitWithDefaultTimeout()