Skip to content

Commit

Permalink
test flake bft deliverer
Browse files Browse the repository at this point in the history
Signed-off-by: Yoav Tock <tock@il.ibm.com>
  • Loading branch information
tock-ibm authored and denyeart committed May 6, 2024
1 parent 906acba commit f074697
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions common/deliverclient/blocksprovider/bft_deliverer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit f074697

Please sign in to comment.