Fix flakes in pauli_string_measurement_with_readout_mitigation_test#7185
Fix flakes in pauli_string_measurement_with_readout_mitigation_test#7185pavoljuhas merged 3 commits intoquantumlib:mainfrom
Conversation
Ensure random Pauli strings have a non-identity operator for real.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7185 +/- ##
==========================================
- Coverage 98.14% 98.14% -0.01%
==========================================
Files 1100 1100
Lines 96194 96191 -3
==========================================
- Hits 94412 94408 -4
- Misses 1782 1783 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
NoureldinYosri
left a comment
There was a problem hiding this comment.
can this be a symptom of a real bug?
The test flakes were failing on Pauli string validation which rejects identity-only strings, for example, https://github.com/quantumlib/Cirq/actions/runs/14068636480/job/39397251223#step:7:402 The original test code intended to avoid such strings, but could in fact produce them with This PR ensures that there is at least one non-identity Pauli in the operators dictionary, which prevents the flake. |
|
Thanks for fixing it! I recall adding the Pauli-I validation to the verification stage, but I overlooked the need to prevent the generation of all Pauli-I test strings in the test file. Thanks for catching the error and fix it quickly! |
…uantumlib#7185) * Deflake pauli_string_measurement_with_readout_mitigation_test Ensure random Pauli strings have a non-identity operator for real. * Add missing spaces to exception message * Simplify - make do without an extra local variable
Ensure random Pauli strings have a non-identity operator for real.
Also add missing spaces to the exception message.
This fixes randomly-seed dependent test failure for
cc: @ddddddanni