From 2873afeb757e1ffaf29650be2f64541a4571f0a8 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Wed, 15 Sep 2021 13:02:58 -0600 Subject: [PATCH] e2e test cleanup: check exit statuses The e2e Cleanup handlers run various 'rm' commands, but don't check the exit status of any. This masks real problems such as the unlinkat-EBUSY flake (#11594) which only triggers on container/pod rm. Solution: check exit status: a failure in cleanup will now be considered a failure in the test itself. Signed-off-by: Ed Santiago --- test/e2e/common_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go index 20ed72c591..91be3d137c 100644 --- a/test/e2e/common_test.go +++ b/test/e2e/common_test.go @@ -483,14 +483,18 @@ func (p *PodmanTestIntegration) Cleanup() { // Remove all containers stopall := p.Podman([]string{"stop", "-a", "--time", "0"}) stopall.WaitWithDefaultTimeout() + Expect(stopall).Should(Exit(0)) podstop := p.Podman([]string{"pod", "stop", "-a", "-t", "0"}) podstop.WaitWithDefaultTimeout() + Expect(podstop).Should(Exit(0)) podrm := p.Podman([]string{"pod", "rm", "-fa"}) podrm.WaitWithDefaultTimeout() + Expect(podrm).Should(Exit(0)) session := p.Podman([]string{"rm", "-fa"}) session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) p.StopRemoteService() // Nuke tempdir @@ -507,6 +511,7 @@ func (p *PodmanTestIntegration) CleanupVolume() { // Remove all containers session := p.Podman([]string{"volume", "rm", "-fa"}) session.Wait(90) + Expect(session).Should(Exit(0)) p.Cleanup() } @@ -516,6 +521,7 @@ func (p *PodmanTestIntegration) CleanupSecrets() { // Remove all containers session := p.Podman([]string{"secret", "rm", "-a"}) session.Wait(90) + Expect(session).Should(Exit(0)) // Stop remove service on secret cleanup p.StopRemoteService()