Skip to content

tests: HLASM, C# and Perl timing checks use the CPU-clock helper (Part of #8423) - #8580

Merged
squid-shepherd[bot] merged 1 commit into
mainfrom
churn/8423-20261117T1811Z
Nov 17, 2026
Merged

squid-shepherd[bot] merged 1 commit into
mainfrom
churn/8423-20261117T1811Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #8423

Checklist: partial [c:e628cc47] -- 24 other listed offenders in WALL_CLOCK_OFFENDERS still use raw wall-clock differences (see Sibling gaps).

What changed

The shared helper (tests/_timing.py), the harness/linearity wiring (#8523) and the gate with its shrink-only list (#8548) are already on main. This PR converts four listed offenders and shrinks the list by four:

  • test_hlasm_strict.py: the EPLOC ReDoS payload test uses assert_cpu_below (was a raw perf_counter() < 5).
  • test_hlasm_macro_uses.py: the local _best_of_three becomes cpu_best_of; the macro-use ReDoS test uses assert_cpu_below.
  • test_csharp_strict.py: the two < 5.0 sweeps (func_start, Mode B slicer) use assert_cpu_below. Correctness asserts stay separate from the timing.
  • test_perl_heredoc_imports_6572.py: the hand-copied doubling-ratio _best_of is replaced by linear_assert.assert_linear.
  • test_no_raw_wall_clock_timing_8423.py: the four entries are removed from WALL_CLOCK_OFFENDERS.

Tests only; no engine change, so no golden bless.

Class

A test that asserts "this is fast" from a raw wall-clock difference, in two forms: absolute < N s bounds, and hand-copied doubling-ratio helpers.

Sibling gaps (not fixed here; none needs a burned-estate program)

  • The same doubling-ratio copy: test_go_raw_string_imports_6572.py, test_go_semicolon_imports_6572.py, test_elixir_{heredoc,sigil,string}_imports_6572.py. Each is an assert_linear swap.
  • Not yet inspected: test_c_kernel_vocab_8016.py, test_calls_out_{haskell_juxtaposition,rust_matches_depth,rust_select_arms}_6454.py, tests/core_engine/test_*_probe_4108.py, test_dense_source_750{1,4}.py, test_prefetch.py, test_cics_macro_level.py, tests/cobol_mainframe/test_{pic_run_lengths,translator_pic_runs}_7169.py, tests/security_auditing/test_secrets_shunt_4987.py, test_tls_bypass_*_6239.py.
  • test_redos_poison.py uses time.monotonic for a subprocess stall watchdog, not an assertion. It likely needs an allow-list reason rather than a conversion.

Verification

  • The 4 converted files plus test_no_raw_wall_clock_timing_8423.py and test_wall_clock_gate_detector_8423.py: 615 passed in about 10 s.
  • ruff format --check clean on all 5 files.
  • python tests/ruff_audit.py --ci: no new findings beyond the baseline.
  • The one F841 in test_csharp_strict.py was already on main, so I left it.

Lessons for agents

  • A bare cat > with no heredoc hangs Bash on stdin: write scratch and PR-body files with the Write tool (already listed in python-test-traps.md).

🤖 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 17, 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 17, 2026 18:17
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 17, 2026 18:17
@squid-shepherd
squid-shepherd Bot merged commit 2745eb8 into main Nov 17, 2026
57 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/8423-20261117T1811Z branch November 17, 2026 18: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