Problem
During full-suite validation for #130, tests/test_runner_subcall_reporting.py::test_llm_batch_with_errors_bounded_concurrency observed peak == 1 while asserting peak == 2. An immediate isolated rerun passed. The production batch result was correct; the test relies on time.sleep(0.02) being long enough for two worker threads to overlap, which is scheduler-sensitive on a loaded machine.
Direction
Replace the sleep-only overlap assumption with deterministic synchronization (for example, a barrier/event that holds the first two admitted requests until both are active), while retaining the upper-bound assertion and avoiding a deadlock if the executor regresses to one worker.
Evidence
Problem
During full-suite validation for #130,
tests/test_runner_subcall_reporting.py::test_llm_batch_with_errors_bounded_concurrencyobservedpeak == 1while assertingpeak == 2. An immediate isolated rerun passed. The production batch result was correct; the test relies ontime.sleep(0.02)being long enough for two worker threads to overlap, which is scheduler-sensitive on a loaded machine.Direction
Replace the sleep-only overlap assumption with deterministic synchronization (for example, a barrier/event that holds the first two admitted requests until both are active), while retaining the upper-bound assertion and avoiding a deadlock if the executor regresses to one worker.
Evidence
peakwas 1).