From e67d906fc93928b9b7553a35df4cc1fc43365646 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Sat, 14 Mar 2026 10:11:26 -0400 Subject: [PATCH] kubectl/drain: widen namespace termination retry timeout TestEvictDuringNamespaceTerminating intentionally exercises the retry path but only allows 10ms of total time. The production loop sleeps, refreshes state, and retries under that same deadline, so a single retry plus scheduler jitter is enough to exhaust the budget under -race or on busy CI workers. Keep the retry interval small so the test still covers the retry behavior, but widen the overall timeout so the assertion measures semantics instead of machine speed. Tested: go test -race ./staging/src/k8s.io/kubectl/pkg/drain -run TestEvictDuringNamespaceTerminating -count=100 Kubernetes-commit: 77f8d7c2a9571dd9a76ee1be8b234a4dddd2ad35 --- pkg/drain/drain_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/drain/drain_test.go b/pkg/drain/drain_test.go index 373241054..60fabb9f0 100644 --- a/pkg/drain/drain_test.go +++ b/pkg/drain/drain_test.go @@ -536,7 +536,9 @@ func TestEvictDuringNamespaceTerminating(t *testing.T) { testNamespace := "default" retryDelay := 5 * time.Millisecond - globalTimeout := 2 * retryDelay + // Give the helper enough room for a retry plus scheduler jitter on loaded CI + // hosts. A 10ms total timeout is too small under -race. + globalTimeout := 20 * retryDelay tests := []struct { description string