Skip to content

Commit 5d28db4

Browse files
committed
unify the default timeout
Signed-off-by: Wei Liu <liuweixa@redhat.com>
1 parent 165365c commit 5d28db4

File tree

7 files changed

+58
-55
lines changed

7 files changed

+58
-55
lines changed

test/e2e/pkg/cert_rotation_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ var _ = Describe("Certificate Rotation", Ordered, Label("e2e-tests-cert-rotation
103103
return fmt.Errorf("expected 1 replica, got %d", *deployment.Spec.Replicas)
104104
}
105105
return nil
106-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
106+
}).ShouldNot(HaveOccurred())
107107

108108
By("verifying work status is reported back")
109109
Eventually(func() error {
@@ -118,7 +118,7 @@ var _ = Describe("Certificate Rotation", Ordered, Label("e2e-tests-cert-rotation
118118
return fmt.Errorf("work not available yet")
119119
}
120120
return nil
121-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
121+
}).ShouldNot(HaveOccurred())
122122
})
123123

124124
AfterAll(func() {
@@ -156,7 +156,7 @@ var _ = Describe("Certificate Rotation", Ordered, Label("e2e-tests-cert-rotation
156156
By("ensuring the work is deleted")
157157
Eventually(func() error {
158158
return AssertWorkNotFound(workName)
159-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
159+
}).ShouldNot(HaveOccurred())
160160

161161
By("ensuring the deployment is deleted from agent cluster")
162162
Eventually(func() error {
@@ -168,7 +168,7 @@ var _ = Describe("Certificate Rotation", Ordered, Label("e2e-tests-cert-rotation
168168
return err
169169
}
170170
return fmt.Errorf("deployment %s still exists", deployName)
171-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
171+
}).ShouldNot(HaveOccurred())
172172
})
173173

174174
It("should update work when certificate expires and succeed after rotation", func() {
@@ -210,7 +210,7 @@ var _ = Describe("Certificate Rotation", Ordered, Label("e2e-tests-cert-rotation
210210
return fmt.Errorf("expected 2 replicas, got %d", *deployment.Spec.Replicas)
211211
}
212212
return nil
213-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
213+
}).ShouldNot(HaveOccurred())
214214
})
215215
})
216216
})
@@ -429,7 +429,7 @@ func restartDeployment(ctx context.Context, kubeClient kubernetes.Interface, dep
429429
}
430430

431431
return nil
432-
}, 2*time.Minute, 2*time.Second).ShouldNot(HaveOccurred())
432+
}).ShouldNot(HaveOccurred())
433433

434434
// Give the deployment a moment to establish connections
435435
time.Sleep(5 * time.Second)

test/e2e/pkg/grpc_test.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"fmt"
77
"io"
88
"net/http"
9-
"time"
109

1110
"github.com/cloudevents/sdk-go/v2/binding"
1211
cetypes "github.com/cloudevents/sdk-go/v2/types"
@@ -80,7 +79,7 @@ var _ = Describe("GRPC", Ordered, Label("e2e-tests-grpc"), func() {
8079
}
8180

8281
return nil
83-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
82+
}).ShouldNot(HaveOccurred())
8483

8584
Eventually(func() error {
8685
_, err := agentTestOpts.kubeClientSet.AppsV1().Deployments("default").Get(ctx, deployName, metav1.GetOptions{})
@@ -91,7 +90,7 @@ var _ = Describe("GRPC", Ordered, Label("e2e-tests-grpc"), func() {
9190
return err
9291
}
9392
return fmt.Errorf("nginx deployment still exists")
94-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
93+
}).ShouldNot(HaveOccurred())
9594

9695
_, resp, err := apiClient.DefaultAPI.ApiMaestroV1ResourceBundlesIdGet(ctx, resourceID).Execute()
9796
Expect(err).To(HaveOccurred(), "Expected 404 error")
@@ -104,7 +103,7 @@ var _ = Describe("GRPC", Ordered, Label("e2e-tests-grpc"), func() {
104103
It("should subscribe to the resource status with grpc client", func() {
105104
Eventually(func() error {
106105
return assertResourceStatus(subscribedResourceStatus, resourceID, 1)
107-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
106+
}).ShouldNot(HaveOccurred())
108107
})
109108

110109
It("get the deployment from cluster", func() {
@@ -117,7 +116,7 @@ var _ = Describe("GRPC", Ordered, Label("e2e-tests-grpc"), func() {
117116
return fmt.Errorf("unexpected replicas, expected 1, got %d", *deploy.Spec.Replicas)
118117
}
119118
return nil
120-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
119+
}).ShouldNot(HaveOccurred())
121120
})
122121

123122
It("get the resource via maestro api", func() {
@@ -141,7 +140,7 @@ var _ = Describe("GRPC", Ordered, Label("e2e-tests-grpc"), func() {
141140
It("should subscribe to the resource status with grpc client", func() {
142141
Eventually(func() error {
143142
return assertResourceStatus(subscribedResourceStatus, resourceID, 2)
144-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
143+
}).ShouldNot(HaveOccurred())
145144
})
146145

147146
It("get the deployment from cluster", func() {
@@ -154,7 +153,7 @@ var _ = Describe("GRPC", Ordered, Label("e2e-tests-grpc"), func() {
154153
return fmt.Errorf("unexpected replicas, expected 2, got %d", *deploy.Spec.Replicas)
155154
}
156155
return nil
157-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
156+
}).ShouldNot(HaveOccurred())
158157
})
159158

160159
It("get the resource via maestro api", func() {

test/e2e/pkg/resources_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var _ = Describe("Resources", Ordered, Label("e2e-tests-resources"), func() {
4242
return fmt.Errorf("unexpected replicas, expected 1, got %d", *deploy.Spec.Replicas)
4343
}
4444
return nil
45-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
45+
}).ShouldNot(HaveOccurred())
4646

4747
resourceID = string(createdWork.UID)
4848
gotResource, resp, err := apiClient.DefaultAPI.ApiMaestroV1ResourceBundlesIdGet(ctx, resourceID).Execute()
@@ -66,11 +66,11 @@ var _ = Describe("Resources", Ordered, Label("e2e-tests-resources"), func() {
6666
return err
6767
}
6868
return fmt.Errorf("nginx deployment still exists")
69-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
69+
}).ShouldNot(HaveOccurred())
7070

7171
Eventually(func() error {
7272
return AssertWorkNotFound(workName)
73-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
73+
}).ShouldNot(HaveOccurred())
7474
})
7575

7676
It("patch the resource with source work client", func() {
@@ -120,7 +120,7 @@ var _ = Describe("Resources", Ordered, Label("e2e-tests-resources"), func() {
120120
return err
121121
}
122122
return fmt.Errorf("nginx deployment still exists")
123-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
123+
}).ShouldNot(HaveOccurred())
124124

125125
Eventually(func() error {
126126
_, resp, err := apiClient.DefaultAPI.ApiMaestroV1ResourceBundlesIdGet(ctx, resourceID).Execute()
@@ -131,7 +131,7 @@ var _ = Describe("Resources", Ordered, Label("e2e-tests-resources"), func() {
131131
return fmt.Errorf("unexpected http code, got %d, expected %d", resp.StatusCode, http.StatusNotFound)
132132
}
133133
return nil
134-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
134+
}).ShouldNot(HaveOccurred())
135135

136136
opIDCtx, opID = newOpIDContext(ctx)
137137
By(fmt.Sprintf("create the resource again with source work client (op-id: %s)", opID))
@@ -148,7 +148,7 @@ var _ = Describe("Resources", Ordered, Label("e2e-tests-resources"), func() {
148148
return fmt.Errorf("unexpected replicas, expected 1, got %d", *deploy.Spec.Replicas)
149149
}
150150
return nil
151-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
151+
}).ShouldNot(HaveOccurred())
152152

153153
// the resource id should not change
154154
gotResource, resp, err := apiClient.DefaultAPI.ApiMaestroV1ResourceBundlesIdGet(ctx, resourceID).Execute()
@@ -240,12 +240,12 @@ var _ = Describe("Resources", Ordered, Label("e2e-tests-resources"), func() {
240240
return err
241241
}
242242
return fmt.Errorf("auth secret still exists")
243-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
243+
}).ShouldNot(HaveOccurred())
244244

245245
By("check the resource deletion via source workclient")
246246
Eventually(func() error {
247247
return AssertWorkNotFound(workName)
248-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
248+
}).ShouldNot(HaveOccurred())
249249
})
250250

251251
It("get the resource status back", func() {
@@ -268,7 +268,7 @@ var _ = Describe("Resources", Ordered, Label("e2e-tests-resources"), func() {
268268
}
269269

270270
return fmt.Errorf("work status manifests are empty")
271-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
271+
}).ShouldNot(HaveOccurred())
272272
})
273273
})
274274

@@ -293,15 +293,15 @@ var _ = Describe("Resources", Ordered, Label("e2e-tests-resources"), func() {
293293
By("check the resource deletion via source workclient")
294294
Eventually(func() error {
295295
return AssertWorkNotFound(workName)
296-
}, 2*time.Minute, 2*time.Second).ShouldNot(HaveOccurred())
296+
}).ShouldNot(HaveOccurred())
297297
})
298298

299299
It("check the nested work is created and not updated", func() {
300300
// make sure the nested work is created
301301
Eventually(func() error {
302302
_, err := agentTestOpts.workClientSet.WorkV1().ManifestWorks(nestedWorkNamespace).Get(ctx, nestedWorkName, metav1.GetOptions{})
303303
return err
304-
}, 30*time.Second, time.Second).ShouldNot(HaveOccurred())
304+
}).ShouldNot(HaveOccurred())
305305

306306
// make sure the nested work is not updated
307307
Consistently(func() error {
@@ -315,7 +315,7 @@ var _ = Describe("Resources", Ordered, Label("e2e-tests-resources"), func() {
315315
}
316316

317317
return nil
318-
}, 1*time.Minute, 1*time.Second).Should(BeNil())
318+
}).Should(BeNil())
319319
})
320320
})
321321

@@ -342,7 +342,7 @@ var _ = Describe("Resources", Ordered, Label("e2e-tests-resources"), func() {
342342

343343
Eventually(func() error {
344344
return AssertWorkNotFound(workName)
345-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
345+
}).ShouldNot(HaveOccurred())
346346

347347
})
348348

test/e2e/pkg/sourceclient_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ var _ = Describe("SourceWorkClient", Ordered, Label("e2e-tests-source-work-clien
8080
}
8181

8282
return AssertWorkNotFound(initWorkBName)
83-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
83+
}).ShouldNot(HaveOccurred())
8484

8585
watcherCancel()
8686
})
@@ -139,7 +139,7 @@ var _ = Describe("SourceWorkClient", Ordered, Label("e2e-tests-source-work-clien
139139

140140
Eventually(func() error {
141141
return AssertWatchResult(result)
142-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
142+
}).ShouldNot(HaveOccurred())
143143

144144
expectedMetrics := fmt.Sprintf(`
145145
# HELP source_client_registered_watchers Number of registered watchers for a source client.
@@ -197,18 +197,18 @@ var _ = Describe("SourceWorkClient", Ordered, Label("e2e-tests-source-work-clien
197197

198198
Eventually(func() error {
199199
return AssertWatchResult(allConsumerWatcherResult)
200-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
200+
}).ShouldNot(HaveOccurred())
201201

202202
Eventually(func() error {
203203
return AssertWatchResult(consumerWatcherResult)
204-
}, 30*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
204+
}).ShouldNot(HaveOccurred())
205205

206206
Consistently(func() error {
207207
if len(otherConsumerWatcherResult.WatchedWorks) != 0 {
208208
return fmt.Errorf("unexpected watched works")
209209
}
210210
return nil
211-
}, 10*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
211+
}).ShouldNot(HaveOccurred())
212212

213213
expectedMetrics := fmt.Sprintf(`
214214
# HELP source_client_registered_watchers Number of registered watchers for a source client.
@@ -261,7 +261,7 @@ var _ = Describe("SourceWorkClient", Ordered, Label("e2e-tests-source-work-clien
261261

262262
Eventually(func() error {
263263
return AssertWatchResult(result)
264-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
264+
}).ShouldNot(HaveOccurred())
265265

266266
expectedMetrics := fmt.Sprintf(`
267267
# HELP source_client_registered_watchers Number of registered watchers for a source client.
@@ -334,7 +334,7 @@ var _ = Describe("SourceWorkClient", Ordered, Label("e2e-tests-source-work-clien
334334
return fmt.Errorf("second watcher should have received events")
335335
}
336336
return nil
337-
}, 30*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
337+
}).ShouldNot(HaveOccurred())
338338

339339
By("verify watchers are independent - first watcher stopped, second continues")
340340
Expect(len(firstResult.WatchedWorks)).Should(BeNumerically(">", 0), "first watcher should have processed initial events")
@@ -395,7 +395,7 @@ var _ = Describe("SourceWorkClient", Ordered, Label("e2e-tests-source-work-clien
395395
}
396396

397397
return fmt.Errorf("no deleted work watched")
398-
}, 1*time.Minute, 5*time.Second).ShouldNot(HaveOccurred())
398+
}).ShouldNot(HaveOccurred())
399399
})
400400
})
401401

@@ -491,7 +491,7 @@ var _ = Describe("SourceWorkClient", Ordered, Label("e2e-tests-source-work-clien
491491
}
492492

493493
return AssertWorkNotFound(testWorkCName)
494-
}, 2*time.Minute, 2*time.Second).ShouldNot(HaveOccurred())
494+
}).ShouldNot(HaveOccurred())
495495
})
496496

497497
It("list works with options", func() {
@@ -789,7 +789,7 @@ var _ = Describe("SourceWorkClient", Ordered, Label("e2e-tests-source-work-clien
789789
}
790790

791791
return nil
792-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
792+
}).ShouldNot(HaveOccurred())
793793
})
794794

795795
By("update deploy replicas", func() {
@@ -855,7 +855,7 @@ var _ = Describe("SourceWorkClient", Ordered, Label("e2e-tests-source-work-clien
855855
}
856856

857857
return nil
858-
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
858+
}).ShouldNot(HaveOccurred())
859859
})
860860
})
861861
})

0 commit comments

Comments
 (0)