Given tests: order arrivals by limiter state instead of sleeps (limiter, spread, cancel-while-queued)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 11:20:26 -07:00
co-authored by Claude Fable 5.1
parent 6c3a2cff8a
commit 98faa3a57d
7 changed files with 46 additions and 24 deletions
@@ -84,7 +84,7 @@ hosts = ["alpha"]
default_model = "shared"
`, alpha)
go func() { drain(r.post("/r/v1/chat/completions", conversation(1, 1))) }() // holds the one slot
time.Sleep(100 * time.Millisecond)
waitUntil(t, func() bool { return r.lim.InFlight("alpha", "shared") == 1 })
ctx, cancel := context.WithTimeout(context.Background(), 150*time.Millisecond)
defer cancel()
req, _ := http.NewRequestWithContext(ctx, http.MethodPost, r.front.URL+"/r/v1/chat/completions", strings.NewReader(conversation(2, 1)))