You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test failure in test_find_periodic_pattern in string_tests.py #105639
My immediate question was "What could have happened that this should suddenly fail?" The answer is "Nothing!" For each CI run, reference_find is called 1000 times with random input. There is obviously a non-zero probabilty of generating this corner case for which the test as a whole is wrong. Hence we get an occasional bogus failure. Some possible fixes:
Do not generate this corner case; I have no idea how right now.
Do not test this easy-to-detect case: if not p or not text: continue after text is generated, or perhaps if not p: continue after p is generated.
Change reference_find to return 0 for this case, making sure to not introduce another bug.
The test was added in #86138, with PR by Dennis Sweeny and Tim Peters.
Activity
terryjreedy commentedon Jun 11, 2023
My immediate question was "What could have happened that this should suddenly fail?" The answer is "Nothing!" For each CI run, reference_find is called 1000 times with random input. There is obviously a non-zero probabilty of generating this corner case for which the test as a whole is wrong. Hence we get an occasional bogus failure. Some possible fixes:
if not p or not text: continueaftertextis generated, or perhapsif not p: continueafterpis generated.The test was added in #86138, with PR by Dennis Sweeny and Tim Peters.
hugovk commentedon Mar 7, 2025
Thanks for the report, however it's been subsequently resolved by PR #110170 and issue #110160.