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
This commit is contained in:
Davanum Srinivas 2026-03-14 10:11:26 -04:00 committed by Kubernetes Publisher
parent 3b3daf56ef
commit e67d906fc9

View file

@ -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