Browse Source

e2e: avoid seed nodes when statesyncing (#7006)

pull/7009/head
Sam Kleinman 3 years ago
committed by GitHub
parent
commit
b150ea6b3e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions
  1. +11
    -1
      test/e2e/generator/generate.go

+ 11
- 1
test/e2e/generator/generate.go View File

@ -275,7 +275,17 @@ func generateTestnet(r *rand.Rand, opt map[string]interface{}) (e2e.Manifest, er
}
})
for i, name := range peerNames {
if len(seedNames) > 0 && (i == 0 || r.Float64() >= 0.5) {
// there are seeds, statesync is disabled, and it's
// either the first peer by the sort order, and
// (randomly half of the remaining peers use a seed
// node; otherwise, choose some remaining set of the
// peers.
if len(seedNames) > 0 &&
manifest.Nodes[name].StateSync == e2e.StateSyncDisabled &&
(i == 0 || r.Float64() >= 0.5) {
// choose one of the seeds
manifest.Nodes[name].Seeds = uniformSetChoice(seedNames).Choose(r)
} else if i > 0 {
peers := uniformSetChoice(peerNames[:i])


Loading…
Cancel
Save