From 27debb9790b104841225808d4604b43dfd3d2a3d Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Fri, 25 Sep 2026 11:02:07 -0700 Subject: [PATCH] v1 limiter test: release before reporting in TestParallelAndQueue (race with the final count check) Co-Authored-By: Claude Fable 5.1 --- docs/plans/v1/_files/internal/limiter/limiter_test.go | 2 +- docs/plans/v2/README.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/plans/v1/_files/internal/limiter/limiter_test.go b/docs/plans/v1/_files/internal/limiter/limiter_test.go index bf90588..6ab30e2 100644 --- a/docs/plans/v1/_files/internal/limiter/limiter_test.go +++ b/docs/plans/v1/_files/internal/limiter/limiter_test.go @@ -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 }() diff --git a/docs/plans/v2/README.md b/docs/plans/v2/README.md index 5194a88..b743259 100644 --- a/docs/plans/v2/README.md +++ b/docs/plans/v2/README.md @@ -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.