From b94c5387b878cdb7c567a90d72c41bb86d18f403 Mon Sep 17 00:00:00 2001 From: Peter Hunt Date: Fri, 11 Oct 2024 16:53:33 -0400 Subject: [PATCH] e2e_node: use restart instead of start stop Signed-off-by: Peter Hunt --- test/e2e_node/node_container_manager_test.go | 30 ++++---------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/test/e2e_node/node_container_manager_test.go b/test/e2e_node/node_container_manager_test.go index ce66ac65c48..6761e195a3b 100644 --- a/test/e2e_node/node_container_manager_test.go +++ b/test/e2e_node/node_container_manager_test.go @@ -98,19 +98,10 @@ var _ = SIGDescribe("Node Container Manager", framework.WithSerial(), func() { ginkgo.DeferCleanup(func(ctx context.Context) { if oldCfg != nil { // Update the Kubelet configuration. - ginkgo.By("Stopping the kubelet") - startKubelet := stopKubelet() - - // wait until the kubelet health check will fail - gomega.Eventually(ctx, func() bool { - return kubeletHealthCheck(kubeletHealthCheckURL) - }).WithTimeout(time.Minute).WithPolling(time.Second).Should(gomega.BeFalseBecause("expected kubelet health check to be failed")) - ginkgo.By("Stopped the kubelet") - framework.ExpectNoError(e2enodekubelet.WriteKubeletConfigFile(oldCfg)) - ginkgo.By("Starting the kubelet") - startKubelet() + ginkgo.By("Restarting the kubelet") + restartKubelet(true) // wait until the kubelet health check will succeed gomega.Eventually(ctx, func(ctx context.Context) bool { @@ -127,23 +118,14 @@ var _ = SIGDescribe("Node Container Manager", framework.WithSerial(), func() { newCfg.FailCgroupV1 = true // extra safety. We want to avoid false negatives though, so we added the skip check earlier // Update the Kubelet configuration. - ginkgo.By("Stopping the kubelet") - startKubelet := stopKubelet() - - // wait until the kubelet health check will fail - gomega.Eventually(ctx, func() bool { - return kubeletHealthCheck(kubeletHealthCheckURL) - }).WithTimeout(time.Minute).WithPolling(time.Second).Should(gomega.BeFalseBecause("expected kubelet health check to be failed")) - ginkgo.By("Stopped the kubelet") - framework.ExpectNoError(e2enodekubelet.WriteKubeletConfigFile(newCfg)) - ginkgo.By("Starting the kubelet") - startKubelet() + ginkgo.By("Restarting the kubelet") + restartKubelet(true) // wait until the kubelet health check will succeed - gomega.Eventually(ctx, func() bool { - return getNodeReadyStatus(ctx, f) && kubeletHealthCheck(kubeletHealthCheckURL) + gomega.Eventually(ctx, func(ctx context.Context) bool { + return kubeletHealthCheck(kubeletHealthCheckURL) }).WithTimeout(2 * time.Minute).WithPolling(5 * time.Second).Should(gomega.BeTrueBecause("expected kubelet to be in healthy state")) ginkgo.By("Started the kubelet")