Skip to content

Commit

Permalink
allow time for sts to be created in e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lllamnyp committed Jun 25, 2024
1 parent 8d5a5e3 commit 3910c3b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"os"
"os/exec"
"sync"
"time"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -95,6 +96,15 @@ var _ = Describe("etcd-operator", Ordered, func() {
ExpectWithOffset(1, err).NotTo(HaveOccurred())
})

Eventually(func() error {
cmd := exec.Command("kubectl", "get",
"statefulset/test",
"--namespace", namespace,
)
_, err = utils.Run(cmd)
return err
}, time.Second*20, time.Second*2).Should(Succeed())

By("wait for statefulset is ready", func() {
cmd := exec.Command("kubectl", "wait",
"statefulset/test",
Expand Down Expand Up @@ -144,6 +154,15 @@ var _ = Describe("etcd-operator", Ordered, func() {
ExpectWithOffset(1, err).NotTo(HaveOccurred())
})

Eventually(func() error {
cmd := exec.Command("kubectl", "get",
"statefulset/test",
"--namespace", namespace,
)
_, err = utils.Run(cmd)
return err
}, time.Second*20, time.Second*2).Should(Succeed())

By("wait for statefulset is ready", func() {
cmd := exec.Command("kubectl", "wait",
"statefulset/test",
Expand Down Expand Up @@ -192,6 +211,15 @@ var _ = Describe("etcd-operator", Ordered, func() {
ExpectWithOffset(1, err).NotTo(HaveOccurred())
})

Eventually(func() error {
cmd := exec.Command("kubectl", "get",
"statefulset/test",
"--namespace", namespace,
)
_, err = utils.Run(cmd)
return err
}, time.Second*20, time.Second*2).Should(Succeed())

By("wait for statefulset is ready", func() {
cmd := exec.Command("kubectl", "wait",
"statefulset/test",
Expand Down

0 comments on commit 3910c3b

Please sign in to comment.