v1 limiter test: release before reporting in TestParallelAndQueue (race with the final count check)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 11:02:07 -07:00
co-authored by Claude Fable 5.1
parent 7710352462
commit 27debb9790
2 changed files with 6 additions and 1 deletions
@@ -32,10 +32,10 @@ func TestParallelAndQueue(t *testing.T) {
go func() {
rel, waited, err := l.Acquire(ctx, "alpha", "m")
if err == nil {
defer rel()
if waited < 40*time.Millisecond {
err = errors.New("third acquire did not wait")
}
rel() // release before reporting, so the final count check cannot race it
}
got3 <- err
}()