-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Remove verify_parallel_map script #8962
Conversation
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
6788250
to
0834b47
Compare
Pull Request Test Coverage Report for Build 3372572751
💛 - Coveralls |
In Qiskit#7658 we disabled multiprocessing as part of unittest runs in CI because the multiple layers of parallelism (subprocess from stestr, multiprocessing from qiskit, and multithreading from rust in qiskit) were triggering a latent bug in python's multiprocessing implementation that was blocking CI. To counter the lost coverage from disabling multiprocessing in that PR we added a script verify_parallel_map which force enabled multiprocessing and validated transpile() run in parallel executed correctly. However, in Qiskit#8952 we introduced a model for selectively enabling multiprocessing just for a single test method. This should allow us to avoid the stochastic failure triggering the deadlock in python's multiprocessing by overloading parallelism but still test in isolation that parallel_map() works. This commit builds on the test class introduced in Qiskit#8952 and adds identical test cases to what was previously in verify_parallel_map.py to move that coverage into the unit test suite. Then the verify_parallel_map script is removed and all callers are updated to just run unit tests instead of also executing that script.
0834b47
to
3067250
Compare
Now that #8952 has merged, I've rebased this and it should be ready for review now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a straightforward move of verify_parallel_map.py
into the regular test suite, this looks absolutely fine to me. It's good that it removes a load of complexity from the coverage runs too.
for count in counts: | ||
self.assertTrue(math.isclose(count["0000000000000000"], 500, rel_tol=0.1)) | ||
self.assertTrue(math.isclose(count["0111111111111111"], 500, rel_tol=0.1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For completely random seeding, this would have about a 1/640 failure chance, which would be way too high. It's fine given that we've fixed the seed, though.
Summary
In #7658 we disabled multiprocessing as part of unittest runs in CI
because the multiple layers of parallelism (subprocess from stestr,
multiprocessing from qiskit, and multithreading from rust in qiskit)
were triggering a latent bug in python's multiprocessing implementation
that was blocking CI. To counter the lost coverage from disabling
multiprocessing in that PR we added a script verify_parallel_map which
force enabled multiprocessing and validated transpile() run in parallel
executed correctly. However, in #8952 we introduced a model for
selectively enabling multiprocessing just for a single test method. This
should allow us to avoid the stochastic failure triggering the deadlock
in python's multiprocessing by overloading parallelism but still test in
isolation that parallel_map() works.
This commit builds on the test class introduced in #8952 and adds
identical test cases to what was previously in verify_parallel_map.py to
move that coverage into the unit test suite. Then the
verify_parallel_map script is removed and all callers are updated to
just run unit tests instead of also executing that script.
Details and comments
This PR is based on top of #8952, I've marked this as on hold until #8952 mergesand this PR branch is rebased.