Skip to content

Commit 2030b91

Browse files
authored
wait to enter round (#250)
1 parent c921e48 commit 2030b91

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

epoch_multinode_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,11 @@ func (n *inMemNetwork) triggerLeaderBlockBuilder(round uint64) *testBlock {
658658
if n.IsDisconnected(leader) {
659659
instance.e.Logger.Info("triggering block build on disconnected leader", zap.Stringer("leader", leader))
660660
}
661+
662+
// wait for the node to enter the round we expect it to propose a block for
663+
// otherwise we may trigger a build block too early
664+
waitToEnterRound(n.t, instance.e, round)
665+
661666
instance.bb.triggerNewBlock()
662667
return <-instance.bb.out
663668
}

replication_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ func waitToEnterRound(t *testing.T, e *simplex.Epoch, round uint64) {
931931
case <-time.After(time.Millisecond * 10):
932932
continue
933933
case <-timeout.C:
934-
require.Fail(t, "timed out waiting for event")
934+
require.Fail(t, "timed out waiting to enter round", "current round %d, waiting for round %d", e.Metadata().Round, round)
935935
}
936936
}
937937
}

0 commit comments

Comments
 (0)