mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 04:41:22 +00:00
test: dont start cs until all peers connected
This commit is contained in:
@ -62,7 +62,7 @@ func TestValidatorSetChanges(t *testing.T) {
|
||||
reactors := make([]*ConsensusReactor, nPeers)
|
||||
eventChans := make([]chan interface{}, nPeers)
|
||||
for i := 0; i < nPeers; i++ {
|
||||
reactors[i] = NewConsensusReactor(css[i], false)
|
||||
reactors[i] = NewConsensusReactor(css[i], true) // so we dont start the consensus states
|
||||
|
||||
eventSwitch := events.NewEventSwitch()
|
||||
_, err := eventSwitch.Start()
|
||||
@ -78,6 +78,14 @@ func TestValidatorSetChanges(t *testing.T) {
|
||||
return s
|
||||
}, p2p.Connect2Switches)
|
||||
|
||||
// now that everyone is connected, start the state machines
|
||||
// (otherwise, we could block forever in firing new block while a peer is trying to
|
||||
// access state info for AddPeer)
|
||||
for i := 0; i < nPeers; i++ {
|
||||
s := reactors[i].conS.GetState()
|
||||
reactors[i].SwitchToConsensus(s)
|
||||
}
|
||||
|
||||
// map of active validators
|
||||
activeVals := make(map[string]struct{})
|
||||
for i := 0; i < nVals; i++ {
|
||||
|
Reference in New Issue
Block a user