Browse Source

e2e: stabilize validator update form (#7340)

This might be a source of non-determinism in the e2e test.
pull/7349/head
Sam Kleinman 3 years ago
committed by GitHub
parent
commit
c4033f95c1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      test/e2e/app/app.go

+ 9
- 0
test/e2e/app/app.go View File

@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"path/filepath"
"sort"
"strconv"
"github.com/tendermint/tendermint/abci/example/code"
@ -282,6 +283,14 @@ func (app *Application) validatorUpdates(height uint64) (abci.ValidatorUpdates,
}
valUpdates = append(valUpdates, abci.UpdateValidator(keyBytes, int64(power), app.cfg.KeyType))
}
// the validator updates could be returned in arbitrary order,
// and that seems potentially bad. This orders the validator
// set.
sort.Slice(valUpdates, func(i, j int) bool {
return valUpdates[i].PubKey.Compare(valUpdates[j].PubKey) < 0
})
return valUpdates, nil
}


Loading…
Cancel
Save