From ab7acb9ee39f02f9daef5150e245178bfdf4770f Mon Sep 17 00:00:00 2001 From: Artyom Lukianov Date: Wed, 22 Jul 2020 13:21:42 +0300 Subject: [PATCH] e2e node: fix kubelet service restart failure Under e2e tests possible the situation when we restart the kubelet number of times in the short time frame. When it happens the systemd can fail the service restart with the `Failed with result 'start-limit-hit'.` error. To avoid this situation the code will reset the kubelet service start failures on each call to the kubelet restart command. Signed-off-by: Artyom Lukianov --- test/e2e_node/util.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/e2e_node/util.go b/test/e2e_node/util.go index 0beac34ecda..292c2efca4c 100644 --- a/test/e2e_node/util.go +++ b/test/e2e_node/util.go @@ -387,7 +387,11 @@ func findRunningKubletServiceName() string { func restartKubelet() { kubeletServiceName := findRunningKubletServiceName() - stdout, err := exec.Command("sudo", "systemctl", "restart", kubeletServiceName).CombinedOutput() + // reset the kubelet service start-limit-hit + stdout, err := exec.Command("sudo", "systemctl", "reset-failed", kubeletServiceName).CombinedOutput() + framework.ExpectNoError(err, "Failed to reset kubelet start-limit-hit with systemctl: %v, %v", err, stdout) + + stdout, err = exec.Command("sudo", "systemctl", "restart", kubeletServiceName).CombinedOutput() framework.ExpectNoError(err, "Failed to restart kubelet with systemctl: %v, %v", err, stdout) }