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:
@@ -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
|
||||
}()
|
||||
|
||||
@@ -82,3 +82,8 @@ reason.
|
||||
per argv element, so check 3 could never pass. Test fault (mine): the body now goes through a
|
||||
file (`-d @file`). Ornith diagnosed it correctly. Resumed from the working tree with the
|
||||
corrected script.
|
||||
- 2026-09-25, task 05, third session: `TestParallelAndQueue` (v1 given `limiter_test.go`) failed
|
||||
once under full-suite `-race` load with `after releases: inflight 1 queued 0`. Test fault
|
||||
(mine): the third acquirer sent its result before its deferred release ran, so the final
|
||||
count check could observe one slot still held. The given file now releases before reporting.
|
||||
Ornith found it and measured the flake rate rather than editing the protected file.
|
||||
|
||||
Reference in New Issue
Block a user