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

Increase timeout of a flaky speed test #5756

Merged
merged 3 commits into from
Jul 13, 2022

Conversation

pavoljuhas
Copy link
Collaborator

Increase timeout of circuit_test.py::test_create_speed from 2 to 4 seconds.
Avoid flaky test failures of the GitHub CI Pytest MacOS (3.7).

Avoid flaky GitHub CI failures of Pytest MacOS (3.7).
@pavoljuhas pavoljuhas requested review from a team, vtomole and cduck as code owners July 13, 2022 17:26
@pavoljuhas pavoljuhas requested a review from viathor July 13, 2022 17:26
@CirqBot CirqBot added the Size: XS <10 lines changed label Jul 13, 2022
Copy link
Collaborator

@viathor viathor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one comment. Good to merge once it's addressed.

@@ -4652,11 +4652,16 @@ def test_create_speed():
# Previously this took ~30s to run. Now it should take ~150ms. However the coverage test can
# run this slowly, so allowing 2 sec to account for things like that. Feel free to increase the
# buffer time or delete the test entirely if it ends up causing flakes.
#
# Updated in https://github.com/quantumlib/Cirq/pull/5756
Copy link
Collaborator

@viathor viathor Jul 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a performance regression. Could you file an issue and link to the issue instead of the PR? This way we're not going to loose track of the regression while avoiding the flaky failures for now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack - I have added a printout of the actual test durations locally on my linux box, which was

$ echo '    print("\\nDB: elapsed_time =", time.perf_counter() - t)' >> cirq-core/cirq/circuits/circuit_test.py
$ check/pytest -s -n 0 --cov --cov-config=dev_tools/conf/.coveragerc cirq-core/cirq/circuits/circuit_test.py -k test_create_speed | grep DB:
DB: elapsed_time = 0.4660000840012799
  • 0.48 s at ef40777 which introduced test_create_speed()
  • 0.47 s at this PR

There is no significant change in test time - the failing CI is more likely due to fluctuating loads on the test machines.

@pavoljuhas pavoljuhas added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 13, 2022
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jul 13, 2022
@CirqBot CirqBot merged commit a335ed8 into quantumlib:master Jul 13, 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 Jul 13, 2022
@pavoljuhas pavoljuhas deleted the increase-test-timeout branch July 13, 2022 22:21
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
Increase timeout of `circuit_test.py::test_create_speed` from 2 to 4 seconds.
Avoid flaky test failures of the GitHub CI Pytest MacOS (3.7).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: XS <10 lines changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants