From 945995be107820fa559285a68f5fdfe0ca434106 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Tue, 5 Mar 2024 07:55:06 -0700 Subject: [PATCH] e2e: fix potential race in file-locks test Two test flakes in the past week. Looks like the usual race between "run -d" and "assume the container is ready". I don't know if this will resolve them, but it's still a good idea. Signed-off-by: Ed Santiago --- test/e2e/checkpoint_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/e2e/checkpoint_test.go b/test/e2e/checkpoint_test.go index b2000c5269..dc1a47a1d1 100644 --- a/test/e2e/checkpoint_test.go +++ b/test/e2e/checkpoint_test.go @@ -1449,10 +1449,11 @@ var _ = Describe("Podman checkpoint", func() { }) It("podman checkpoint and restore container with --file-locks", func() { - localRunString := getRunString([]string{"--name", "test_name", ALPINE, "flock", "test.lock", "sleep", "100"}) + localRunString := getRunString([]string{"--name", "test_name", ALPINE, "flock", "test.lock", "sh", "-c", "echo READY;sleep 100"}) session := podmanTest.Podman(localRunString) session.WaitWithDefaultTimeout() Expect(session).Should(ExitCleanly()) + Expect(WaitContainerReady(podmanTest, "test_name", "READY", 5, 1)).To(BeTrue(), "Timed out waiting for READY") // Checkpoint is expected to fail without --file-locks result := podmanTest.Podman([]string{"container", "checkpoint", "test_name"})