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
test(redis-worker): restore real concurrency in batch tests with race-tolerant assertions
The two batch tests that exercise pop-failure / queue-empty behaviour
were temporarily set to concurrency=1 to dodge the worker pool's
parallel-pick race. That collapsed the worker pool and stopped the
tests from validating their semantics under genuine concurrency.
Restored concurrency=5 (matching the rest of the suite) and switched
the non-deterministic counts to bounded-range assertions:
- mid-batch pop failure: actual drained entries are deterministic (the
two bad pops + one good pop); failure count is in [1, concurrency]
because workers that loop after a sibling's empty/null pop can re-pop
the broken env before skip.add propagates. envBadPops is bounded by
drainBatchSize + concurrency — the property is "bounded retry", not
"exactly one".
- stops popping early: popCalls in [3, concurrency + 2] and strictly
less than drainBatchSize — the property is "we don't pop all the way
to the batch ceiling once the queue empties".
These bounds are tight enough to catch a regression to unbounded pops
while tolerating the legitimate race between worker iterations.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments