Skip to content

Commit c2f531c

Browse files
committed
test(e2e): make operator resource creation eventual
Fix operator status spec flake by making resource creation check eventual.
1 parent 75f5440 commit c2f531c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/e2e/operator_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ var _ = Describe("Operator", func() {
4545
})
4646

4747
AfterEach(func() {
48-
toggleCVO()
4948
togglev2alpha1()
49+
toggleCVO()
5050
})
5151

5252
// Ensures that an Operator resource can select its components by label and surface them correctly in its status.
@@ -67,8 +67,11 @@ var _ = Describe("Operator", func() {
6767
It("should surface components in its status", func() {
6868
o := &operatorsv2alpha1.Operator{}
6969
o.SetName(genName("o-"))
70-
o, err := operatorClient.Create(clientCtx, o, createOpts)
71-
Expect(err).ToNot(HaveOccurred())
70+
71+
Eventually(func() error {
72+
_, err := operatorClient.Create(clientCtx, o, createOpts)
73+
return err
74+
}).Should(Succeed())
7275

7376
defer func() {
7477
Expect(operatorClient.Delete(clientCtx, o.GetName(), deleteOpts)).To(Succeed())

0 commit comments

Comments
 (0)