Repository navigation
Timing tests: convert 4 wall-clock offenders to the CPU helper (Part of #8423) - #8696
Merged
Merged
Conversation
#8423) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
|
No description provided. |
Contributor
|
No description provided. |
2 of 3 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 #8423.
Checklist: partial [c:07091220] -- 12 listed offenders remain in
WALL_CLOCK_OFFENDERS(list below), plus the sibling gapsWhat changed
Four tests asserted
time.perf_counter() - start < Non a wall clock. Each now callsassert_cpu_belowfromtests/_timing.py(CPU time of the calling thread, fastest of three, same bound), and its entry is deleted from the shrink-onlyWALL_CLOCK_OFFENDERSintests/tools/test_no_raw_wall_clock_timing_8423.py:tests/core_engine/test_dense_source_7501.py(1.0 s)tests/core_engine/test_dense_source_7504.py(1.0 s)tests/security_auditing/test_tls_bypass_java_6239.py(2 s)tests/security_auditing/test_tls_bypass_dotnet_ps_wget_6239.py(2 s)All four time in-thread work (pure regex / string calls), so
thread_timecounts all of it.Class / Sibling gaps
Class: a test asserts "this is fast" with a raw wall-clock difference (
perf_counter/monotonic/timetaken twice) instead of the shared CPU-clock helper. Same-mechanism members converted here: the four above. The issue cannot be edited, so the full remaining offender list (the checklist's "list every current offender") is here:Remaining offenders (12), all still in
WALL_CLOCK_OFFENDERS:tests/cobol_mainframe/test_pic_run_lengths_7169.py(0.5 s; also times a GnuCOBOL buffer read)tests/cobol_mainframe/test_translator_pic_runs_7169.py(0.5 s)tests/core_engine/test_cics_macro_level.py(2.0 s)tests/core_engine/test_prefetch.py(2 s,time.monotonic)tests/core_engine/test_vectorized_math_probe_4108.py(5 s)tests/extraction/languages/test_c_kernel_vocab_8016.py(1.0 s)tests/extraction/languages/test_calls_out_haskell_juxtaposition_6454.py(assert_redos_immune, 3 s)tests/extraction/languages/test_calls_out_rust_matches_depth_6454.py(5 s)tests/extraction/languages/test_calls_out_rust_select_arms_6454.py(5 s,monotonic)tests/extraction/languages/test_go_semicolon_imports_6572.py(5 s)tests/security_auditing/test_redos_poison.pytests/security_auditing/test_secrets_shunt_4987.py(1.0 s)Sibling gaps (not in this PR; no burned-estate program needs any of them, the COBOL PIC pair is translator-general):
SKIP_PREFIXESskiptests/tools/andtests/extraction/tools/wholesale, so atest_*.pythere (test_timeouts_4904.py,test_zos_probes.py,test_survivor_attack.py,test_equivalence_cics_fault_resp.pycall wall-clock functions) is not checked; whether any asserts on elapsed time is not yet verified.time.time/perf_counter/monotonic(dotted, aliased,from time import); other clocks (datetime.now()differences) are not covered.Remaining slices: (1) the 5
tests/extraction/languages/files, (2) the 2cobol_mainframe+ 3core_enginefiles, (3) the 2security_auditingfiles, then atests/toolsscope review of the gate.Facts checked
test_wall_clock_gate_detector_8423.py: 121 passed from/tmp(plainpytest <file>, notests.import).python tests/tools/audit_check.py: all clear.🤖 Generated with Claude Code