Skip to content

Commit 7d421ab

Browse files
committed
1 parent 2a386de commit 7d421ab

12 files changed

+125
-124
lines changed

controllers/binding_controller_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ var _ = Describe("bindingController", func() {
5656
)
5757

5858
return binding.Status.Conditions
59-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
59+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
6060
"Type": Equal(topology.ConditionType("Ready")),
6161
"Reason": Equal("FailedCreateOrUpdate"),
6262
"Status": Equal(corev1.ConditionFalse),
@@ -81,7 +81,7 @@ var _ = Describe("bindingController", func() {
8181
)
8282

8383
return binding.Status.Conditions
84-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
84+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
8585
"Type": Equal(topology.ConditionType("Ready")),
8686
"Reason": Equal("FailedCreateOrUpdate"),
8787
"Status": Equal(corev1.ConditionFalse),
@@ -113,7 +113,7 @@ var _ = Describe("bindingController", func() {
113113
)
114114

115115
return binding.Status.Conditions
116-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
116+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
117117
"Type": Equal(topology.ConditionType("Ready")),
118118
"Reason": Equal("SuccessfulCreateOrUpdate"),
119119
"Status": Equal(corev1.ConditionTrue),
@@ -137,7 +137,7 @@ var _ = Describe("bindingController", func() {
137137
)
138138

139139
return binding.Status.Conditions
140-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
140+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
141141
"Type": Equal(topology.ConditionType("Ready")),
142142
"Reason": Equal("SuccessfulCreateOrUpdate"),
143143
"Status": Equal(corev1.ConditionTrue),
@@ -159,7 +159,7 @@ var _ = Describe("bindingController", func() {
159159
Consistently(func() bool {
160160
err := client.Get(ctx, types.NamespacedName{Name: binding.Name, Namespace: binding.Namespace}, &topology.Binding{})
161161
return apierrors.IsNotFound(err)
162-
}, 5).Should(BeFalse())
162+
}, statusEventsUpdateTimeout).Should(BeFalse())
163163
Expect(observedEvents()).To(ContainElement("Warning FailedDelete failed to delete binding"))
164164
})
165165
})
@@ -229,7 +229,7 @@ var _ = Describe("bindingController", func() {
229229
)
230230

231231
return binding.Status.Conditions
232-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
232+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
233233
"Type": Equal(topology.ConditionType("Ready")),
234234
"Reason": Equal("FailedCreateOrUpdate"),
235235
"Status": Equal(corev1.ConditionFalse),
@@ -268,7 +268,7 @@ var _ = Describe("bindingController", func() {
268268
)
269269

270270
return binding.Status.Conditions
271-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
271+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
272272
"Type": Equal(topology.ConditionType("Ready")),
273273
"Reason": Equal("SuccessfulCreateOrUpdate"),
274274
"Status": Equal(corev1.ConditionTrue),
@@ -306,7 +306,7 @@ var _ = Describe("bindingController", func() {
306306
)
307307

308308
return binding.Status.Conditions
309-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
309+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
310310
"Type": Equal(topology.ConditionType("Ready")),
311311
"Reason": Equal("SuccessfulCreateOrUpdate"),
312312
"Status": Equal(corev1.ConditionTrue),

controllers/exchange_controller_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ var _ = Describe("exchange-controller", func() {
5656
)
5757

5858
return exchange.Status.Conditions
59-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
59+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
6060
"Type": Equal(topology.ConditionType("Ready")),
6161
"Reason": Equal("FailedCreateOrUpdate"),
6262
"Status": Equal(corev1.ConditionFalse),
@@ -81,7 +81,7 @@ var _ = Describe("exchange-controller", func() {
8181
)
8282

8383
return exchange.Status.Conditions
84-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
84+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
8585
"Type": Equal(topology.ConditionType("Ready")),
8686
"Reason": Equal("FailedCreateOrUpdate"),
8787
"Status": Equal(corev1.ConditionFalse),
@@ -113,7 +113,7 @@ var _ = Describe("exchange-controller", func() {
113113
)
114114

115115
return exchange.Status.Conditions
116-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
116+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
117117
"Type": Equal(topology.ConditionType("Ready")),
118118
"Reason": Equal("SuccessfulCreateOrUpdate"),
119119
"Status": Equal(corev1.ConditionTrue),
@@ -139,7 +139,7 @@ var _ = Describe("exchange-controller", func() {
139139
&exchange,
140140
)
141141
return exchange.Status.Conditions
142-
}, 10*time.Second, 1*time.Second).Should(ConsistOf(MatchFields(IgnoreExtras, Fields{
142+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ConsistOf(MatchFields(IgnoreExtras, Fields{
143143
"Type": Equal(topology.ConditionType("Ready")),
144144
"Status": Equal(corev1.ConditionTrue),
145145
})))
@@ -180,7 +180,7 @@ var _ = Describe("exchange-controller", func() {
180180
&exchange,
181181
)
182182
return exchange.Status.Conditions
183-
}, 10*time.Second, 1*time.Second).Should(ConsistOf(MatchFields(IgnoreExtras, Fields{
183+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ConsistOf(MatchFields(IgnoreExtras, Fields{
184184
"Type": Equal(topology.ConditionType("Ready")),
185185
"Status": Equal(corev1.ConditionFalse),
186186
"Reason": Equal("FailedCreateOrUpdate"),
@@ -205,7 +205,7 @@ var _ = Describe("exchange-controller", func() {
205205
)
206206

207207
return exchange.Status.Conditions
208-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
208+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
209209
"Type": Equal(topology.ConditionType("Ready")),
210210
"Reason": Equal("SuccessfulCreateOrUpdate"),
211211
"Status": Equal(corev1.ConditionTrue),
@@ -227,7 +227,7 @@ var _ = Describe("exchange-controller", func() {
227227
Consistently(func() bool {
228228
err := client.Get(ctx, types.NamespacedName{Name: exchange.Name, Namespace: exchange.Namespace}, &topology.Exchange{})
229229
return apierrors.IsNotFound(err)
230-
}, 5).Should(BeFalse())
230+
}, statusEventsUpdateTimeout).Should(BeFalse())
231231
Expect(observedEvents()).To(ContainElement("Warning FailedDelete failed to delete exchange"))
232232
})
233233
})
@@ -243,7 +243,7 @@ var _ = Describe("exchange-controller", func() {
243243
Consistently(func() bool {
244244
err := client.Get(ctx, types.NamespacedName{Name: exchange.Name, Namespace: exchange.Namespace}, &topology.Exchange{})
245245
return apierrors.IsNotFound(err)
246-
}, 5).Should(BeFalse())
246+
}, statusEventsUpdateTimeout).Should(BeFalse())
247247
Expect(observedEvents()).To(ContainElement("Warning FailedDelete failed to delete exchange"))
248248
})
249249
})
@@ -262,7 +262,7 @@ var _ = Describe("exchange-controller", func() {
262262
Eventually(func() bool {
263263
err := client.Get(ctx, types.NamespacedName{Name: exchange.Name, Namespace: exchange.Namespace}, &topology.Exchange{})
264264
return apierrors.IsNotFound(err)
265-
}, 5).Should(BeTrue())
265+
}, statusEventsUpdateTimeout).Should(BeTrue())
266266
Expect(observedEvents()).To(SatisfyAll(
267267
Not(ContainElement("Warning FailedDelete failed to delete exchange")),
268268
ContainElement("Normal SuccessfulDelete successfully deleted exchange"),
@@ -297,7 +297,7 @@ var _ = Describe("exchange-controller", func() {
297297
)
298298

299299
return exchange.Status.Conditions
300-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
300+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
301301
"Type": Equal(topology.ConditionType("Ready")),
302302
"Reason": Equal("FailedCreateOrUpdate"),
303303
"Status": Equal(corev1.ConditionFalse),
@@ -336,7 +336,7 @@ var _ = Describe("exchange-controller", func() {
336336
)
337337

338338
return exchange.Status.Conditions
339-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
339+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
340340
"Type": Equal(topology.ConditionType("Ready")),
341341
"Reason": Equal("SuccessfulCreateOrUpdate"),
342342
"Status": Equal(corev1.ConditionTrue),
@@ -374,7 +374,7 @@ var _ = Describe("exchange-controller", func() {
374374
)
375375

376376
return exchange.Status.Conditions
377-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
377+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
378378
"Type": Equal(topology.ConditionType("Ready")),
379379
"Reason": Equal("SuccessfulCreateOrUpdate"),
380380
"Status": Equal(corev1.ConditionTrue),

controllers/federation_controller_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var _ = Describe("federation-controller", func() {
5858
)
5959

6060
return federation.Status.Conditions
61-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
61+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
6262
"Type": Equal(topology.ConditionType("Ready")),
6363
"Reason": Equal("FailedCreateOrUpdate"),
6464
"Status": Equal(corev1.ConditionFalse),
@@ -83,7 +83,7 @@ var _ = Describe("federation-controller", func() {
8383
)
8484

8585
return federation.Status.Conditions
86-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
86+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
8787
"Type": Equal(topology.ConditionType("Ready")),
8888
"Reason": Equal("FailedCreateOrUpdate"),
8989
"Status": Equal(corev1.ConditionFalse),
@@ -122,7 +122,7 @@ var _ = Describe("federation-controller", func() {
122122
)
123123

124124
return federation.Status.Conditions
125-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
125+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
126126
"Type": Equal(topology.ConditionType("Ready")),
127127
"Reason": Equal("SuccessfulCreateOrUpdate"),
128128
"Status": Equal(corev1.ConditionTrue),
@@ -146,7 +146,7 @@ var _ = Describe("federation-controller", func() {
146146
)
147147

148148
return federation.Status.Conditions
149-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
149+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
150150
"Type": Equal(topology.ConditionType("Ready")),
151151
"Reason": Equal("SuccessfulCreateOrUpdate"),
152152
"Status": Equal(corev1.ConditionTrue),
@@ -168,7 +168,7 @@ var _ = Describe("federation-controller", func() {
168168
Consistently(func() bool {
169169
err := client.Get(ctx, types.NamespacedName{Name: federation.Name, Namespace: federation.Namespace}, &topology.Federation{})
170170
return apierrors.IsNotFound(err)
171-
}, 5).Should(BeFalse())
171+
}, statusEventsUpdateTimeout).Should(BeFalse())
172172
Expect(observedEvents()).To(ContainElement("Warning FailedDelete failed to delete federation"))
173173
})
174174
})
@@ -184,7 +184,7 @@ var _ = Describe("federation-controller", func() {
184184
Consistently(func() bool {
185185
err := client.Get(ctx, types.NamespacedName{Name: federation.Name, Namespace: federation.Namespace}, &topology.Federation{})
186186
return apierrors.IsNotFound(err)
187-
}, 5).Should(BeFalse())
187+
}, statusEventsUpdateTimeout).Should(BeFalse())
188188
Expect(observedEvents()).To(ContainElement("Warning FailedDelete failed to delete federation"))
189189
})
190190
})
@@ -203,7 +203,7 @@ var _ = Describe("federation-controller", func() {
203203
Eventually(func() bool {
204204
err := client.Get(ctx, types.NamespacedName{Name: federation.Name, Namespace: federation.Namespace}, &topology.Federation{})
205205
return apierrors.IsNotFound(err)
206-
}, 5).Should(BeTrue())
206+
}, statusEventsUpdateTimeout).Should(BeTrue())
207207
Expect(observedEvents()).To(SatisfyAll(
208208
Not(ContainElement("Warning FailedDelete failed to delete federation")),
209209
ContainElement("Normal SuccessfulDelete successfully deleted federation"),
@@ -241,7 +241,7 @@ var _ = Describe("federation-controller", func() {
241241
)
242242

243243
return federation.Status.Conditions
244-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
244+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
245245
"Type": Equal(topology.ConditionType("Ready")),
246246
"Reason": Equal("FailedCreateOrUpdate"),
247247
"Status": Equal(corev1.ConditionFalse),
@@ -283,7 +283,7 @@ var _ = Describe("federation-controller", func() {
283283
)
284284

285285
return federation.Status.Conditions
286-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
286+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
287287
"Type": Equal(topology.ConditionType("Ready")),
288288
"Reason": Equal("SuccessfulCreateOrUpdate"),
289289
"Status": Equal(corev1.ConditionTrue),
@@ -324,7 +324,7 @@ var _ = Describe("federation-controller", func() {
324324
)
325325

326326
return federation.Status.Conditions
327-
}, 10*time.Second, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
327+
}, statusEventsUpdateTimeout, 1*time.Second).Should(ContainElement(MatchFields(IgnoreExtras, Fields{
328328
"Type": Equal(topology.ConditionType("Ready")),
329329
"Reason": Equal("SuccessfulCreateOrUpdate"),
330330
"Status": Equal(corev1.ConditionTrue),

0 commit comments

Comments
 (0)