@@ -16,6 +16,7 @@ import (
1616"github.com/loft-sh/devspace/pkg/devspace/devpod"
1717"github.com/loft-sh/devspace/pkg/util/factory"
1818"github.com/onsi/ginkgo/v2"
19+ "github.com/onsi/gomega"
1920kerrors "k8s.io/apimachinery/pkg/api/errors"
2021metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2122"k8s.io/apimachinery/pkg/util/wait"
@@ -138,9 +139,18 @@ sleep 1000000
138139})
139140framework .ExpectNoError (err )
140141
141- // make sure the pod exists
142- err = kubeClient .RawClient ().CoreV1 ().Pods (ns ).Delete (context .TODO (), podName , metav1.DeleteOptions {})
143- framework .ExpectNoError (err )
142+ gomega .Eventually (func (g gomega.Gomega ) {
143+ // make sure the pod exists
144+ _ , err := kubeClient .RawClient ().CoreV1 ().Pods (ns ).Get (context .TODO (), podName , metav1.GetOptions {})
145+ g .Expect (err ).NotTo (gomega .HaveOccurred ())
146+
147+ // delete it
148+ err = kubeClient .RawClient ().CoreV1 ().Pods (ns ).Delete (context .TODO (), podName , metav1.DeleteOptions {})
149+ g .Expect (err ).NotTo (gomega .HaveOccurred ())
150+ }).
151+ WithPolling (1 * time .Second ).
152+ WithTimeout (30 * time .Second ).
153+ Should (gomega .Succeed ())
144154
145155// wait until pod is terminated
146156err = wait .PollUntilContextTimeout (context .TODO (), time .Second , time .Minute * 3 , true , func (ctx context.Context ) (done bool , err error ) {
0 commit comments