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 <imran@kinvolk.io>
This commit is contained in:
Imran Pochi 2022-03-07 18:51:07 +05:30
parent debd461d03
commit 5ef0be2f58

View File

@ -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())
})
})