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 <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2023-04-12 21:15:17 +02:00
parent b9ba850440
commit 629a6a6e45

View File

@ -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)