Sleep-based timing shortcut blocked before write

A real `tokio::time::sleep(...)` call in a file-search test reached the pre-write lane through `RUST-ANTI-TESTSLEEP-001`, with remediation pointed toward paused time or an injected clock.

Last checked 2026-03-26Musha, SadaveRUST-ANTI-TESTSLEEP-001

Sleep-based timing shortcut blocked before write

Summary

A real tokio::time::sleep(...) call reached the write lane and was rejected before it could settle into repository test style. The block stayed attached to the exact line that introduced the timing shortcut.

Trigger

tokio::time::sleep(std::time::Duration::from_millis(150)).await;

This was not a vague timing smell. It was a real sleep-based timing shortcut inside repository test code.

System response

The hook emitted BLOCK with RUST-ANTI-TESTSLEEP-001 and redirected the fix toward deterministic time control: inject a clock port, or run with paused time and advance it explicitly. The report ties the same rule, file, and code range back to the block.

Outcome

The write did not proceed. The incident survived as a report with an exact mirror MCR instead of disappearing into terminal output.

Why it mattered

Nondeterministic timing was rejected before the write entered the repo and before the workaround could harden into normal test style.

Current note

Historical block. The exact 150ms sleep snippet is no longer present in current source, but the rejection remains verified through the preserved report trail.