From b63a210dd977630e2335acb92a60bf84251df8c7 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 7 Nov 2025 15:04:20 +0100 Subject: [PATCH] test/e2e: try to fix clean up after terminated build flake It is failing with: replacing mount point ".../root/overlay/xxx/merged": directory not empty First, the build does not need network so ensure we don't leak network allocations by killing it. Second, kill is always async so ensure to wait for the actul build process exit. Signed-off-by: Paul Holzinger --- test/e2e/prune_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/e2e/prune_test.go b/test/e2e/prune_test.go index c0ccac0d04..eadf8b2539 100644 --- a/test/e2e/prune_test.go +++ b/test/e2e/prune_test.go @@ -12,6 +12,7 @@ import ( . "github.com/containers/podman/v6/test/utils" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + . "github.com/onsi/gomega/gexec" ) var pruneImage = fmt.Sprintf(` @@ -601,7 +602,7 @@ var _ = Describe("Podman prune", func() { err := os.WriteFile(containerFilePath, []byte(longBuildImage), 0o755) Expect(err).ToNot(HaveOccurred()) - build := podmanTest.Podman([]string{"build", "-f", containerFilePath, "-t", "podmanleaker"}) + build := podmanTest.Podman([]string{"build", "--network=none", "-f", containerFilePath, "-t", "podmanleaker"}) // Build will never finish so let's wait for build to ask for SIGKILL to simulate a failed build that leaves stage containers. matchedOutput := false for range 900 { @@ -616,6 +617,10 @@ var _ = Describe("Podman prune", func() { Fail("Did not match special string in podman build") } + // kill is async, wait for process exit here and make sure it was killed (137). + build.WaitWithDefaultTimeout() + Expect(build).To(Exit(137)) + // Check Intermediate image of stage container none := podmanTest.Podman([]string{"images", "-a"}) none.WaitWithDefaultTimeout()