mirror of
https://github.com/containers/podman.git
synced 2025-06-24 19:42:56 +08:00
ginkgo v2: fix new Skip() behavior
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 <pholzing@redhat.com>
This commit is contained in:
@ -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"})
|
||||
|
Reference in New Issue
Block a user