Skip to content

Commit 095f23d

Browse files
committed
Fix test timing issue
1 parent b10a61c commit 095f23d

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

internal/mode/static/handler_test.go

+19-4
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,10 @@ var _ = Describe("eventHandler", func() {
213213
Expect(fakeProvisioner.RegisterGatewayCallCount()).Should(Equal(0))
214214
Expect(fakeGenerator.GenerateCallCount()).Should(Equal(0))
215215
// status update for GatewayClass should still occur
216-
Expect(fakeStatusUpdater.UpdateGroupCallCount()).Should(Equal(1))
216+
Eventually(
217+
func() int {
218+
return fakeStatusUpdater.UpdateGroupCallCount()
219+
}).Should(Equal(1))
217220
})
218221
})
219222

@@ -260,7 +263,11 @@ var _ = Describe("eventHandler", func() {
260263

261264
Expect(handler.GetLatestConfiguration()).To(BeNil())
262265

263-
Expect(fakeStatusUpdater.UpdateGroupCallCount()).To(Equal(1))
266+
Eventually(
267+
func() int {
268+
return fakeStatusUpdater.UpdateGroupCallCount()
269+
}).Should(Equal(1))
270+
264271
_, name, reqs := fakeStatusUpdater.UpdateGroupArgsForCall(0)
265272
Expect(name).To(Equal(groupControlPlane))
266273
Expect(reqs).To(HaveLen(1))
@@ -275,7 +282,11 @@ var _ = Describe("eventHandler", func() {
275282

276283
Expect(handler.GetLatestConfiguration()).To(BeNil())
277284

278-
Expect(fakeStatusUpdater.UpdateGroupCallCount()).To(Equal(1))
285+
Eventually(
286+
func() int {
287+
return fakeStatusUpdater.UpdateGroupCallCount()
288+
}).Should(Equal(1))
289+
279290
_, name, reqs := fakeStatusUpdater.UpdateGroupArgsForCall(0)
280291
Expect(name).To(Equal(groupControlPlane))
281292
Expect(reqs).To(HaveLen(1))
@@ -303,7 +314,11 @@ var _ = Describe("eventHandler", func() {
303314

304315
Expect(handler.GetLatestConfiguration()).To(BeNil())
305316

306-
Expect(fakeStatusUpdater.UpdateGroupCallCount()).To(Equal(1))
317+
Eventually(
318+
func() int {
319+
return fakeStatusUpdater.UpdateGroupCallCount()
320+
}).Should(Equal(1))
321+
307322
_, name, reqs := fakeStatusUpdater.UpdateGroupArgsForCall(0)
308323
Expect(name).To(Equal(groupControlPlane))
309324
Expect(reqs).To(BeEmpty())

0 commit comments

Comments
 (0)