Repository navigation
tests: one CPU-clock helper for ReDoS harnesses and linearity check (Part of #8423) - #8523
Merged
Merged
Conversation
…and linearity helper use it (Part of #8423) REDOS_LIMIT_S stated once in tests/_timing.py; cpu_best_of (thread_time, fastest of three, retry only after an over-limit run) drives the ReDoS child timers; linear_assert defaults to thread_time. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… (Part of #8423) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
|
No description provided. |
This was referenced Nov 16, 2026
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.
What
tests/_timing.pyalready held the CPU-clock helpers; this slice makes the ReDoS harnesses and the linearity helper use them, with the limit stated once.REDOS_LIMIT_S = 1.0andCPU_REPEATS = 3live intests/_timing.py; both harnesses' defaulttimeout_seccomes from it.cpu_best_of(work, limit_s): fastest CPU time of up to three runs, returning after the first run that is under the limit (a passing regex costs one run; only a slow first run pays for retries). The child timers in_strict_harness.pyand_extraction_harness.pyuse it.best_cpu_secondstakes an injectableclock;linear_assert.pynow defaults totime.thread_time(wasperf_counter) and delegates to it. The fake-clock meta-test (main is red: GitGalaxy Smoke Tests #8132) still passes.tests/core_engine/test_timing_helper_8423.pypins best-of semantics, retry-only-after-slow, and that both harnesses take their default from the helper.Class
A test that judges elapsed time with a raw or single-sample clock, with its own copy of the limit.
Remaining slices
time.time()/perf_counter()/monotonic()difference asserts in tests, plus the shrink-only offender list (checklist items 2-3).test_hlasm_macro_uses.py(_best_of_three,test_macro_use_scans_are_redos_immune),test_hlasm_strict.py:934, and about 36test_*.pyfiles usingperf_counter/time.time/monotonic(e.g.test_dense_source_7501/7504,test_cics_macro_level,test_uef_length_invariance,test_prefetch).Gates
ruff check/format on changed files,
audit_check.pyall clear,pr_gates --ratchets --only-ratchets timePASS, 643 timing/ReDoS/linearity tests pass.Checklist: partial [c:e628cc47] -- the gate and offender list (items 2-3) and the other offenders remain
🤖 Generated with Claude Code