Skip to content

Fix tests that break python-repeat #5431

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

Merged
merged 2 commits into from
Jun 2, 2022
Merged

Conversation

dabacon
Copy link
Collaborator

@dabacon dabacon commented Jun 2, 2022

I use python-repeat to check for flaky tests. It allows you to pass in --count XXX to repeat a test multiple times. Interestingly, for parameterized tests the decorator that creates the parameterized tests is run once globally, and then the tests are repeated. This means that these tests can catch places where the parameterized values are mutated in some way during a test.

This fixes the cases found from check/pytest --count 100. In general mutating parameters called to functions without being very explicit about it is something we should try to avoid.

@CirqBot CirqBot added the size: S 10< lines changed <50 label Jun 2, 2022
@dabacon dabacon marked this pull request as ready for review June 2, 2022 00:10
@dabacon dabacon requested review from a team, vtomole and cduck as code owners June 2, 2022 00:10
@dabacon dabacon requested a review from tanujkhattar June 2, 2022 00:10
@dabacon dabacon added the kind/health For CI/testing/release process/refactoring/technical debt items label Jun 2, 2022
@MichaelBroughton MichaelBroughton self-assigned this Jun 2, 2022
@MichaelBroughton MichaelBroughton added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jun 2, 2022
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jun 2, 2022
@CirqBot CirqBot merged commit 95acc60 into quantumlib:master Jun 2, 2022
@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Jun 2, 2022
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
I use python-repeat to check for flaky tests.  It allows you to pass in `--count XXX` to repeat a test multiple times.  Interestingly, for parameterized tests the decorator that creates the parameterized tests is run once globally, and then the tests are repeated.  This means that these tests can catch places where the parameterized values are mutated in some way during a test.  

This fixes the cases found from `check/pytest --count 100`.  In general mutating parameters called to functions without being very explicit about it is something we should try to avoid.
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
I use python-repeat to check for flaky tests.  It allows you to pass in `--count XXX` to repeat a test multiple times.  Interestingly, for parameterized tests the decorator that creates the parameterized tests is run once globally, and then the tests are repeated.  This means that these tests can catch places where the parameterized values are mutated in some way during a test.  

This fixes the cases found from `check/pytest --count 100`.  In general mutating parameters called to functions without being very explicit about it is something we should try to avoid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/health For CI/testing/release process/refactoring/technical debt items size: S 10< lines changed <50
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants