Skip to content

Commit

Permalink
e2e test cleanup: check exit statuses
Browse files Browse the repository at this point in the history
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 (containers#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 <[email protected]>
  • Loading branch information
edsantiago committed Sep 15, 2021
1 parent c0cde37 commit 2873afe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/e2e/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
}
Expand All @@ -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()
Expand Down

0 comments on commit 2873afe

Please sign in to comment.