Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/gov/keeper: fix flaky TestPaginatedVotesQuery (backport #9223) #9225

Merged
merged 2 commits into from
Apr 29, 2021

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Apr 28, 2021

This is an automatic backport of pull request #9223 done by Mergify.
Cherry-pick of 6ad84c5 has failed:

On branch mergify/bp/release/v0.42.x/pr-9223
Your branch is up to date with 'origin/release/v0.42.x'.

You are currently cherry-picking commit 6ad84c506.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   x/gov/keeper/querier_test.go

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.io/

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

(cherry picked from commit 6ad84c5)

# Conflicts:
#	x/gov/keeper/querier_test.go
@mergify mergify bot added the conflicts label Apr 28, 2021
@amaury1093 amaury1093 merged commit 75f84b5 into release/v0.42.x Apr 29, 2021
@amaury1093 amaury1093 deleted the mergify/bp/release/v0.42.x/pr-9223 branch April 29, 2021 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants