Skip to content

Commit e9b5461

Browse files
committed
test: fix terminal test expectation
Signed-off-by: Russell Centanni <russell.centanni@gmail.com>
1 parent 73401c7 commit e9b5461

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

e2e/tests/terminal/terminal.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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"
1920
kerrors "k8s.io/apimachinery/pkg/api/errors"
2021
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2122
"k8s.io/apimachinery/pkg/util/wait"
@@ -138,9 +139,18 @@ sleep 1000000
138139
})
139140
framework.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
146156
err = wait.PollUntilContextTimeout(context.TODO(), time.Second, time.Minute*3, true, func(ctx context.Context) (done bool, err error) {

0 commit comments

Comments
 (0)