Skip to content

Commit

Permalink
Make tests more stable
Browse files Browse the repository at this point in the history
  • Loading branch information
AMecea committed Dec 19, 2018
1 parent adb093d commit c76a067
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions pkg/controller/orchestrator/orchestrator_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,6 @@ var _ = Describe("Orchestrator controller", func() {
By("wait for a first reconcile event")
// this is a sincronization event
Eventually(requests, 4*time.Second).Should(Receive(Equal(expectedRequest)))

// expect to not receive any event when a cluster is created, but
// just after reconcile time passed then receive a reconcile event
Consistently(requests, noReconcileTime).ShouldNot(Receive(Equal(expectedRequest)))

By("waiting a reconcile event")
Eventually(requests, reconcileTimeout).Should(Receive(Equal(expectedRequest)))

})

AfterEach(func() {
Expand All @@ -160,7 +152,11 @@ var _ = Describe("Orchestrator controller", func() {
})

It("should trigger reconciliation after noReconcileTime", func() {
// expect to not receive any event when a cluster is created, but
// just after reconcile time passed then receive a reconcile event
Consistently(requests, noReconcileTime).ShouldNot(Receive(Equal(expectedRequest)))

// wait for the second request
Eventually(requests, reconcileTimeout).Should(Receive(Equal(expectedRequest)))
})

Expand Down

0 comments on commit c76a067

Please sign in to comment.