mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 13:57:38 +00:00
Cancel informer watch connections before tearing down the test apiserver to avoid hitting the 60s http.Server.Shutdown drain timeout. Each subtest was blocking on open watch connections, adding ~300s to the total suite runtime. Decouple the informer lifecycle from the apiserver by using a separate cancellable context for factory.Start(). Go's defer LIFO ordering ensures the informer stops before test.cleanUp() shuts down the server. Also reduce EncryptionConfigFileChangePollDuration to 1s in TestMain.