-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
Flaky test in rem/tests/test_inverse_confusion_matrix.py
#2431
Comments
Noticed the same failure for windows-python 3.11 |
The same failure on windows-python3.12 |
I am unassigning this for myself because I cannot replicate this locally. My laptop does not have enough memory for local docker containers. |
Looks like this is also happening on ubuntu: https://github.com/unitaryfund/mitiq/actions/runs/10267476608/job/28408109210?pr=2452#step:6:4486 |
Took a look at this in the mitiq coding call today and made some progress. Problemmitiq/mitiq/rem/tests/test_inverse_confusion_matrix.py Lines 32 to 33 in 56ee173
This test (in essence)
Some stats tell us the sum should fall in this range 99.94% of the time, meaning that on average we should see a value outside this range every 1,667 runs. SolutionsWe considered the following solutions
Solution 1 was determined to be unnecessary since we still want this code's functionality to be tested with cases other than the rudimentary ones tested in this same test. Solution 2 was determined to not be a complete fix, as it is still possible for the test to fail, albeit much less likely. Solution 3 was deemed the best solution. DiagnosisWe ran the failing test on my machine (macos) on repeat 2000 times using the approach outlined here. We found it failed roughly at that cadence (1/2000 runs) which aligns with the math in the section above. |
And just so no one else clashes here, I have a PR incoming. |
Great investigation! |
Noticed this failure twice in a CI run for Windows. If I rerun the test, it passes.
https://github.com/unitaryfund/mitiq/actions/runs/9748119578/job/26902405324?pr=2347#step:6:4326
The text was updated successfully, but these errors were encountered: