From 629a6a6e456367de8dcb85b6700d8f662910a02a Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Wed, 12 Apr 2023 21:15:17 +0200 Subject: [PATCH] test/e2e: actually check for cleanup errors We blindy trust these commands to work but as it turns out they do not under certain circumstances. The "podman run ipcns ipcmk container test" can be used to fail this reliably, if a container has dependencies the order of rm --all may cause it to fail because the contianers are deleted in the wrong order. This is th eonly one I found so far, adding this will uncover many more of such problems without proper cleanup we leak processes and ginkgo v2 will block because of them. Of course this cannot be merged without fixing these issues. Signed-off-by: Paul Holzinger --- test/e2e/common_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go index 4e2d2fe2e4..9fa1251355 100644 --- a/test/e2e/common_test.go +++ b/test/e2e/common_test.go @@ -577,6 +577,10 @@ func (p *PodmanTestIntegration) Cleanup() { rmall := p.Podman([]string{"rm", "-fa", "-t", "0"}) rmall.WaitWithDefaultTimeout() + // make sure to only check exit code after both commands ran otherwise we leak when pod rm fails + Expect(podrm).To(Exit(0)) + Expect(rmall).To(Exit(0)) + p.StopRemoteService() // Nuke tempdir p.removeCache(p.TempDir)