diff --git a/common/deliverclient/blocksprovider/bft_deliverer_test.go b/common/deliverclient/blocksprovider/bft_deliverer_test.go index ab1e01a6bc0..2774c3a2bb9 100644 --- a/common/deliverclient/blocksprovider/bft_deliverer_test.go +++ b/common/deliverclient/blocksprovider/bft_deliverer_test.go @@ -1113,18 +1113,17 @@ func TestBFTDeliverer_CensorshipMonitorEvents(t *testing.T) { setup.monErrC <- &blocksprovider.ErrCensorship{Message: fmt.Sprintf("censorship %d", n)} }() - setup.gWithT.Eventually( - func() int { - setup.mutex.Lock() - defer setup.mutex.Unlock() + numMon := func() int { + setup.mutex.Lock() + defer setup.mutex.Unlock() - return len(setup.monitorSet) - }).Should(Equal(n + 1)) + return len(setup.monitorSet) + } + setup.gWithT.Eventually(numMon, 10*time.Second, 10*time.Millisecond).Should(Equal(n + 1)) setup.gWithT.Eventually(setup.fakeDialer.DialCallCount).Should(Equal(n + 1)) setup.gWithT.Expect(setup.fakeSleeper.SleepCallCount()).To(Equal(n)) setup.gWithT.Eventually(setup.fakeCensorshipMonFactory.CreateCallCount).Should(Equal(n + 1)) - } t.Log("Exponential backoff after every round, with saturation")