Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x/gov/keeper: fix flaky TestPaginatedVotesQuery (#9223)
When testing with -race, sometimes the random source generate the same string for consecutive calls, causing duplicated voter address. So the number of votes in DB is not 20. To fix this, we ensure unique addresses are generated, by using a map for tracking which one was produced, and skip the duplicated address and generated new one. Testing with: go test -race -v -count=1000 -run=TestPaginatedVotesQuery now passes. Updates #9010
- Loading branch information