Repository navigation
tests: retry the timing measurement in test_catches_the_3205_pattern (Part of #5166) - #5374
Merged
Merged
Conversation
…(Part of #5166) Noise only lowers a measured growth, so up to 3 measurements of the same pattern keep the assertion and coverage unchanged but stop a noisy runner from failing it. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Owner
Author
|
No description provided. |
squid-protocol
marked this pull request as ready for review
October 17, 2026 21:50
Owner
Author
|
No description provided. |
Owner
Author
|
No description provided. |
squid-protocol
enabled auto-merge (squash)
October 17, 2026 21:50
Owner
Author
|
No description provided. |
3 of 14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #5166.
Change
test_catches_the_3205_patternmeasured the pre-fixEXEC\s+CICS.*?END-EXEC\.pattern once. A noisy measurement (a 40k-char timing near the 0.25 s threshold, or a growth ratio) could miss the offender. The test now takes up to 3 measurements and uses the first offending verdict. Assertions (offender; unit starts withEXEC CICS) are unchanged;measure()and its thresholds are untouched. Noise only adds time, so a retry cannot turn a clean (linear) pattern into an offender.Class table (timing-sensitive single-shot measurement in the ReDoS sweep tests)
test_catches_the_3205_patterntest_catches_a_mild_quadratic_by_growthtest_bounded_heavy_linear_pattern_is_not_an_offender,test_match_is_measured_at_position_zero_onlyEvidence
Not reproduced locally: 15 measurements under 2x CPU oversubscription all passed (the sweep times on thread CPU time). Idle, the
EXEC CICSpayload at 40k chars takes 0.41 s vs the 0.25 s threshold. The retry is a defensive fix for the CI-only flake, not a verified root cause.Gates
pytest on the file (10 passed),
pr_gates.py --fast6/6. Tests only; no golden bless.Sibling gaps
test_catches_a_mild_quadratic_by_growth: same single-measurement shape; not in this PR (no observed flake, would need its own evidence). Source: tests/cobol_mainframe/test_tool_regex_redos.py.Remaining slices
None.
Lessons for agents
measure()times onthread_time, so local CPU contention does not reproduce this flake; the margin overSLOW_Sis only ~1.7x on an idle box.🤖 Generated with Claude Code