Browse Source

Merge pull request #849 from tendermint/846-fix-TestFullRound1-race

fix TestFullRound1 race (Refs #846)
pull/842/merge
Ethan Buchman 7 years ago
committed by GitHub
parent
commit
0cd642bca7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions
  1. +9
    -0
      consensus/state_test.go
  2. +3
    -1
      test/p2p/peer.sh

+ 9
- 0
consensus/state_test.go View File

@ -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)


+ 3
- 1
test/p2p/peer.sh View File

@ -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"

Loading…
Cancel
Save