diff --git a/consensus/state_test.go b/consensus/state_test.go index 290eb026..49ec1185 100644 --- a/consensus/state_test.go +++ b/consensus/state_test.go @@ -10,6 +10,7 @@ import ( cstypes "github.com/tendermint/tendermint/consensus/types" "github.com/tendermint/tendermint/types" cmn "github.com/tendermint/tmlibs/common" + "github.com/tendermint/tmlibs/log" tmpubsub "github.com/tendermint/tmlibs/pubsub" ) @@ -240,6 +241,14 @@ func TestFullRound1(t *testing.T) { cs, vss := randConsensusState(1) height, round := cs.Height, cs.Round + // NOTE: buffer capacity of 0 ensures we can validate prevote and last commit + // before consensus can move to the next height (and cause a race condition) + cs.eventBus.Stop() + eventBus := types.NewEventBusWithBufferCapacity(0) + eventBus.SetLogger(log.TestingLogger().With("module", "events")) + cs.SetEventBus(eventBus) + eventBus.Start() + voteCh := subscribe(cs.eventBus, types.EventQueryVote) propCh := subscribe(cs.eventBus, types.EventQueryCompleteProposal) newRoundCh := subscribe(cs.eventBus, types.EventQueryNewRound) diff --git a/test/p2p/peer.sh b/test/p2p/peer.sh index 3b8322b6..d5ede231 100644 --- a/test/p2p/peer.sh +++ b/test/p2p/peer.sh @@ -14,6 +14,8 @@ set +eu echo "starting tendermint peer ID=$ID" # start tendermint container on the network +# NOTE: $NODE_FLAGS should be unescaped (no quotes). otherwise it will be +# treated as one flag. set -u docker run -d \ --net="$NETWORK_NAME" \ @@ -25,4 +27,4 @@ docker run -d \ --log-opt syslog-address=udp://127.0.0.1:5514 \ --log-opt syslog-facility=daemon \ --log-opt tag="{{.Name}}" \ - "$DOCKER_IMAGE" node "$NODE_FLAGS" --log_level=debug --proxy_app="$APP_PROXY" + "$DOCKER_IMAGE" node $NODE_FLAGS --log_level=debug --proxy_app="$APP_PROXY"