activator tests: a half-second Shutdown budget for the unproven start
The test's Shutdown polls an unproven start until its budget ends, so the budget is the test's whole wait. 500 ms is still five polls; the lease must stay held through all of them, as it had to through twenty.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+3
−1
internal/activator/shutdown_lease_test.go+3 −1
diff --git a/internal/activator/shutdown_lease_test.go b/internal/activator/shutdown_lease_test.go| index 4b7c24297..8cd206127 100644 |
| --- a/internal/activator/shutdown_lease_test.go |
| +++ b/internal/activator/shutdown_lease_test.go |
| @@ -113,7 +113,9 @@ func TestAnAbortedStartNotProvenStoppedKeepsItsLease(t *testing.T) { |
| b.legacyStopErr = errors.New("stop carlos-instance@unproven: instance control socket: connection refused") |
| b.mu.Unlock() |
| - ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) |
| + // An unproven start keeps Shutdown polling until its budget ends, so |
| + // the budget is all this test waits: half a second is five of its polls. |
| + ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond) |
| defer cancel() |
| a.Shutdown(ctx) |