Browse Source

fix failure in TestProposerFrequency (#3293)

```
--- FAIL: TestProposerFrequency (2.50s)

panic: empty validator set [recovered]

        panic: empty validator set



goroutine 91 [running]:

testing.tRunner.func1(0xc000a98c00)

        /usr/local/go/src/testing/testing.go:792 +0x6a7

panic(0xeae7e0, 0x11fbb30)

        /usr/local/go/src/runtime/panic.go:513 +0x1b9

github.com/tendermint/tendermint/types.(*ValidatorSet).RescalePriorities(0xc0000e7380, 0x0)

        /go/src/github.com/tendermint/tendermint/types/validator_set.go:106 +0x1ac

github.com/tendermint/tendermint/state.TestProposerFrequency(0xc000a98c00)

        /go/src/github.com/tendermint/tendermint/state/state_test.go:335 +0xb44

testing.tRunner(0xc000a98c00, 0x111a4d8)

        /usr/local/go/src/testing/testing.go:827 +0x163

created by testing.(*T).Run

        /usr/local/go/src/testing/testing.go:878 +0x65a

FAIL    github.com/tendermint/tendermint/state  3.139s
```
pull/3297/head
Anca Zamfir 5 years ago
committed by Anton Kaliaev
parent
commit
966b5bdf6e
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      state/state_test.go

+ 2
- 2
state/state_test.go View File

@ -313,12 +313,12 @@ func TestProposerFrequency(t *testing.T) {
}
}
// some random test cases with up to 300 validators
// some random test cases with up to 100 validators
maxVals := 100
maxPower := 1000
nTestCases := 5
for i := 0; i < nTestCases; i++ {
N := cmn.RandInt() % maxVals
N := cmn.RandInt()%maxVals + 1
vals := make([]*types.Validator, N)
totalVotePower := int64(0)
for j := 0; j < N; j++ {


Loading…
Cancel
Save