From 0c99f623aa7cf6063badb7edb38ead1a90922a6d 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 4d7fd57a4c..40b498be78 100644 --- a/test/e2e/prune_test.go +++ b/test/e2e/prune_test.go @@ -12,6 +12,7 @@ import ( . "github.com/containers/podman/v5/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()