mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-05 04:55:18 +00:00
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
```
This commit is contained in:
committed by
Anton Kaliaev
parent
021b5cc7f6
commit
966b5bdf6e
@@ -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++ {
|
||||
|
||||
Reference in New Issue
Block a user