Skip to content

Commit

Permalink
ginkgo v2: fix new Skip() behavior
Browse files Browse the repository at this point in the history
It looks like AfterEach() is now executed even after Skip(), this is a
good idea because the fact that it did't before caused us to leak tmp
directories. However in case Skip() is called before the podmanTest is
initialized it will no result in a panic. To fix it simply prevent such
panic by checking the pointer against nil and do nothing in such case.

Signed-off-by: Paul Holzinger <[email protected]>
  • Loading branch information
Luap99 committed May 2, 2023
1 parent cd46e72 commit bc1ed07
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 @@ -569,6 +569,12 @@ func (p *PodmanTestIntegration) Quadlet(args []string, sourceDir string) *Podman

// Cleanup cleans up the temporary store
func (p *PodmanTestIntegration) Cleanup() {
// ginkgo v2 still goes into AfterEach() when Skip() was called,
// some tests call skip before the podman test is initialized.
if p == nil {
return
}

// first stop everything, rm -fa is unreliable
// https://github.com/containers/podman/issues/18180
stop := p.Podman([]string{"stop", "--all", "-t", "0"})
Expand Down

0 comments on commit bc1ed07

Please sign in to comment.