Skip to content

Commit b94c538

Browse files
committed
e2e_node: use restart instead of start stop
Signed-off-by: Peter Hunt <[email protected]>
1 parent cc87438 commit b94c538

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

test/e2e_node/node_container_manager_test.go

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,10 @@ var _ = SIGDescribe("Node Container Manager", framework.WithSerial(), func() {
9898
ginkgo.DeferCleanup(func(ctx context.Context) {
9999
if oldCfg != nil {
100100
// Update the Kubelet configuration.
101-
ginkgo.By("Stopping the kubelet")
102-
startKubelet := stopKubelet()
103-
104-
// wait until the kubelet health check will fail
105-
gomega.Eventually(ctx, func() bool {
106-
return kubeletHealthCheck(kubeletHealthCheckURL)
107-
}).WithTimeout(time.Minute).WithPolling(time.Second).Should(gomega.BeFalseBecause("expected kubelet health check to be failed"))
108-
ginkgo.By("Stopped the kubelet")
109-
110101
framework.ExpectNoError(e2enodekubelet.WriteKubeletConfigFile(oldCfg))
111102

112-
ginkgo.By("Starting the kubelet")
113-
startKubelet()
103+
ginkgo.By("Restarting the kubelet")
104+
restartKubelet(true)
114105

115106
// wait until the kubelet health check will succeed
116107
gomega.Eventually(ctx, func(ctx context.Context) bool {
@@ -127,23 +118,14 @@ var _ = SIGDescribe("Node Container Manager", framework.WithSerial(), func() {
127118
newCfg.FailCgroupV1 = true // extra safety. We want to avoid false negatives though, so we added the skip check earlier
128119

129120
// Update the Kubelet configuration.
130-
ginkgo.By("Stopping the kubelet")
131-
startKubelet := stopKubelet()
132-
133-
// wait until the kubelet health check will fail
134-
gomega.Eventually(ctx, func() bool {
135-
return kubeletHealthCheck(kubeletHealthCheckURL)
136-
}).WithTimeout(time.Minute).WithPolling(time.Second).Should(gomega.BeFalseBecause("expected kubelet health check to be failed"))
137-
ginkgo.By("Stopped the kubelet")
138-
139121
framework.ExpectNoError(e2enodekubelet.WriteKubeletConfigFile(newCfg))
140122

141-
ginkgo.By("Starting the kubelet")
142-
startKubelet()
123+
ginkgo.By("Restarting the kubelet")
124+
restartKubelet(true)
143125

144126
// wait until the kubelet health check will succeed
145-
gomega.Eventually(ctx, func() bool {
146-
return getNodeReadyStatus(ctx, f) && kubeletHealthCheck(kubeletHealthCheckURL)
127+
gomega.Eventually(ctx, func(ctx context.Context) bool {
128+
return kubeletHealthCheck(kubeletHealthCheckURL)
147129
}).WithTimeout(2 * time.Minute).WithPolling(5 * time.Second).Should(gomega.BeTrueBecause("expected kubelet to be in healthy state"))
148130
ginkgo.By("Started the kubelet")
149131

0 commit comments

Comments
 (0)