carlos / platform Public

zdd-5 final review: bound TestSwapConcurrencyIsNeverExceeded's loop (T6 triage)

A queue that stops admitting now fails the test after 100 admission
rounds instead of spinning until the test binary's timeout on a shared box.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev c602f638ff302e5017665908997a9b1b7740deff parent b55273b
1 file changed, +8 −1
  • internal/rollout/admit_test.go +8 −1
diff --git a/internal/rollout/admit_test.go b/internal/rollout/admit_test.go
index 92e446cb0..dd2eb5b01 100644
--- a/internal/rollout/admit_test.go
+++ b/internal/rollout/admit_test.go
@@ -44,7 +44,14 @@ func TestSwapConcurrencyIsNeverExceeded(t *testing.T) {
q := awakeQueue(noBlocks, "a", "b", "c", "d")
q.concurrency = 1
releaseAll(q, "v2", "a", "b", "c", "d")
- for done := 0; done < 4; {
+ // Four attempts need four rounds. The cap turns a queue that stops
+ // admitting into a failure instead of a test that spins until its
+ // timeout on a shared box.
+ const maxRounds = 100
+ for round, done := 0, 0; done < 4; round++ {
+ if round == maxRounds {
+ t.Fatalf("%d of 4 attempts finished after %d admission rounds: the queue stopped admitting", done, maxRounds)
+ }
ds := q.admit(currentView(q), t0)
if q.running > q.concurrency || len(ds) > 1 {
t.Fatalf("running %d, admitted %d, with concurrency %d", q.running, len(ds), q.concurrency)