From 5ef0be2f588204fd65634cc48ae74e63f5eb4e40 Mon Sep 17 00:00:00 2001 From: Imran Pochi Date: Mon, 7 Mar 2022 18:51:07 +0530 Subject: [PATCH] Remove the restart kubelet check from the test. Upon reconsidering as to the purpose of the test i.e to test the lock contention flags (--lock-file-contention and --lock-file), it makes sense that we test only the actual functionality which is the kubelet should stop once there is a lock contention. In no way it is the responsiblity of the kubelet to restart, which would be the responsiblity of a higher system such as systemd. Hence the removal of the check for releasing the lock and checking for whether the kubelet is healthy again or not seem out of scope from kubelet's responsiblities. Signed-off-by: Imran Pochi --- test/e2e_node/lock_contention_linux_test.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/test/e2e_node/lock_contention_linux_test.go b/test/e2e_node/lock_contention_linux_test.go index ae01b23ebc3..c310b330e3a 100644 --- a/test/e2e_node/lock_contention_linux_test.go +++ b/test/e2e_node/lock_contention_linux_test.go @@ -67,21 +67,9 @@ var _ = SIGDescribe("Lock contention [Slow] [Disruptive] [NodeSpecialFeature:Loc ginkgo.By("verifying the kubelet is not healthy as there was a lock contention.") // Once the lock is acquired, check if the kubelet is in healthy state or not. - // It should not be. + // It should not be as the lock contention forces the kubelet to stop. gomega.Eventually(func() bool { return kubeletHealthCheck(kubeletHealthCheckURL) }, 10*time.Second, time.Second).Should(gomega.BeFalse()) - - ginkgo.By("releasing the lock on lock file i.e /var/run/kubelet.lock, triggering kubelet restart.") - // Release the lock. - err = unix.Flock(fd, unix.LOCK_UN) - framework.ExpectNoError(err) - - // Releasing the lock triggers kubelet to re-acquire the lock and restart. - ginkgo.By("verifying the kubelet is healthy after restart.") - // Kubelet should report healthy state. - gomega.Eventually(func() bool { - return kubeletHealthCheck(kubeletHealthCheckURL) - }, 10*time.Second, time.Second).Should(gomega.BeTrue()) }) })