Skip to content

Timing tests: convert 4 wall-clock offenders to the CPU helper (Part of #8423) - #8696

Merged
squid-shepherd[bot] merged 1 commit into
mainfrom
churn/8423-20261119T2044Z
Nov 19, 2026
Merged

squid-shepherd[bot] merged 1 commit into
mainfrom
churn/8423-20261119T2044Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #8423.

Checklist: partial [c:07091220] -- 12 listed offenders remain in WALL_CLOCK_OFFENDERS (list below), plus the sibling gaps

What changed

Four tests asserted time.perf_counter() - start < N on a wall clock. Each now calls assert_cpu_below from tests/_timing.py (CPU time of the calling thread, fastest of three, same bound), and its entry is deleted from the shrink-only WALL_CLOCK_OFFENDERS in tests/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_time counts all of it.

Class / Sibling gaps

Class: a test asserts "this is fast" with a raw wall-clock difference (perf_counter / monotonic / time taken 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.py
  • tests/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):

  • The 12 files above: same mechanism, next slices of at most 5 files each; why not here: the 5-hand-written-file cap.
  • The gate's SKIP_PREFIXES skip tests/tools/ and tests/extraction/tools/ wholesale, so a test_*.py there (test_timeouts_4904.py, test_zos_probes.py, test_survivor_attack.py, test_equivalence_cics_fault_resp.py call wall-clock functions) is not checked; whether any asserts on elapsed time is not yet verified.
  • The gate counts only 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 2 cobol_mainframe + 3 core_engine files, (3) the 2 security_auditing files, then a tests/tools scope review of the gate.

Facts checked

  • The four files plus the gate test and test_wall_clock_gate_detector_8423.py: 121 passed from /tmp (plain pytest <file>, no tests. import).
  • python tests/tools/audit_check.py: all clear.
  • No parsing code changed: no golden bless.

🤖 Generated with Claude Code

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 19, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 19, 2026 20:57
@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md labels Nov 19, 2026
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 19, 2026 21:06
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit 2eb5eb1 into main Nov 19, 2026
59 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/8423-20261119T2044Z branch November 19, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant