You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
engine: test_rank_and_filter_truncates_to_max_loops builds 250 loops to trip production MAX_LOOPS=200 #667
test_rank_and_filter_truncates_to_max_loops in src/simlin-engine/src/ltm_finding.rs (around line 3740) builds MAX_LOOPS + 50 = 250 FoundLoops to verify truncation against the productionMAX_LOOPS = 200 threshold:
This violates the documented rule in docs/dev/rust.md ("Do not test production threshold gates by building fixtures large enough to trip them -- use a test-only override and a tiny fixture").
Why it's an easy fix now
The test-only override already exists: MaxLoopsGuard + MAX_LOOPS_OVERRIDE (the #[cfg(test)] thread-local consulted by effective_max_loops/max_loops_for_call) were added in commit 76db318. So the migration is trivial: wrap the test in a MaxLoopsGuard with a small cap (e.g. 3) and build a tiny fixture (cap + a few loops) instead of 250.
Severity
Low (pure test hygiene). The test is cheap today (<1ms), so this is not a test-time-budget problem -- it is a consistency-with-the-documented-pattern cleanup, and it future-proofs against the fixture cost scaling if MAX_LOOPS is ever raised.
Identified during an LTM-hardening session while reviewing the ltm_finding.rs test suite against the MaxLoopsGuard override that commit 76db318 introduced.
Activity
LTM hardening: close out the top tracked gaps from epic #488 (#668)