mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-20 18:21:22 +00:00
Merge pull request #849 from tendermint/846-fix-TestFullRound1-race
fix TestFullRound1 race (Refs #846)
This commit is contained in:
commit
0cd642bca7
@ -10,6 +10,7 @@ import (
|
|||||||
cstypes "github.com/tendermint/tendermint/consensus/types"
|
cstypes "github.com/tendermint/tendermint/consensus/types"
|
||||||
"github.com/tendermint/tendermint/types"
|
"github.com/tendermint/tendermint/types"
|
||||||
cmn "github.com/tendermint/tmlibs/common"
|
cmn "github.com/tendermint/tmlibs/common"
|
||||||
|
"github.com/tendermint/tmlibs/log"
|
||||||
tmpubsub "github.com/tendermint/tmlibs/pubsub"
|
tmpubsub "github.com/tendermint/tmlibs/pubsub"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -240,6 +241,14 @@ func TestFullRound1(t *testing.T) {
|
|||||||
cs, vss := randConsensusState(1)
|
cs, vss := randConsensusState(1)
|
||||||
height, round := cs.Height, cs.Round
|
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)
|
voteCh := subscribe(cs.eventBus, types.EventQueryVote)
|
||||||
propCh := subscribe(cs.eventBus, types.EventQueryCompleteProposal)
|
propCh := subscribe(cs.eventBus, types.EventQueryCompleteProposal)
|
||||||
newRoundCh := subscribe(cs.eventBus, types.EventQueryNewRound)
|
newRoundCh := subscribe(cs.eventBus, types.EventQueryNewRound)
|
||||||
|
@ -14,6 +14,8 @@ set +eu
|
|||||||
|
|
||||||
echo "starting tendermint peer ID=$ID"
|
echo "starting tendermint peer ID=$ID"
|
||||||
# start tendermint container on the network
|
# start tendermint container on the network
|
||||||
|
# NOTE: $NODE_FLAGS should be unescaped (no quotes). otherwise it will be
|
||||||
|
# treated as one flag.
|
||||||
set -u
|
set -u
|
||||||
docker run -d \
|
docker run -d \
|
||||||
--net="$NETWORK_NAME" \
|
--net="$NETWORK_NAME" \
|
||||||
@ -25,4 +27,4 @@ docker run -d \
|
|||||||
--log-opt syslog-address=udp://127.0.0.1:5514 \
|
--log-opt syslog-address=udp://127.0.0.1:5514 \
|
||||||
--log-opt syslog-facility=daemon \
|
--log-opt syslog-facility=daemon \
|
||||||
--log-opt tag="{{.Name}}" \
|
--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"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user