Skip to content

Commit 4354705

Browse files
committed
UPSTREAM: <carry>: e2e_node: use restart instead of start stop
Signed-off-by: Peter Hunt <pehunt@redhat.com>
1 parent 3ebe892 commit 4354705

File tree

1 file changed

+9
-27
lines changed

1 file changed

+9
-27
lines changed

test/e2e_node/node_container_manager_test.go

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -93,24 +93,15 @@ var _ = SIGDescribe("Node Container Manager [Serial]", func() {
9393
ginkgo.DeferCleanup(func(ctx context.Context) {
9494
if oldCfg != nil {
9595
// Update the Kubelet configuration.
96-
ginkgo.By("Stopping the kubelet")
97-
startKubelet := stopKubelet()
98-
99-
// wait until the kubelet health check will fail
100-
gomega.Eventually(ctx, func() bool {
101-
return kubeletHealthCheck(kubeletHealthCheckURL)
102-
}).WithTimeout(time.Minute).WithPolling(time.Second).Should(gomega.BeFalseBecause("expected kubelet health check to be failed"))
103-
ginkgo.By("Stopped the kubelet")
104-
10596
framework.ExpectNoError(e2enodekubelet.WriteKubeletConfigFile(oldCfg))
10697

107-
ginkgo.By("Starting the kubelet")
108-
startKubelet()
98+
ginkgo.By("Restarting the kubelet")
99+
restartKubelet(true)
109100

110101
// wait until the kubelet health check will succeed
111102
gomega.Eventually(ctx, func(ctx context.Context) bool {
112103
return kubeletHealthCheck(kubeletHealthCheckURL)
113-
}).WithTimeout(2 * time.Minute).WithPolling(5 * time.Second).Should(gomega.BeTrueBecause("expected kubelet to be in healthy state"))
104+
}).WithTimeout(2 * time.Minute).WithPolling(5 * time.Second).Should(gomega.BeTrue())
114105
ginkgo.By("Started the kubelet")
115106
}
116107
})
@@ -121,29 +112,20 @@ var _ = SIGDescribe("Node Container Manager [Serial]", func() {
121112
newCfg.CgroupDriver = "systemd"
122113

123114
// Update the Kubelet configuration.
124-
ginkgo.By("Stopping the kubelet")
125-
startKubelet := stopKubelet()
126-
127-
// wait until the kubelet health check will fail
128-
gomega.Eventually(ctx, func() bool {
129-
return kubeletHealthCheck(kubeletHealthCheckURL)
130-
}).WithTimeout(time.Minute).WithPolling(time.Second).Should(gomega.BeFalseBecause("expected kubelet health check to be failed"))
131-
ginkgo.By("Stopped the kubelet")
132-
133115
framework.ExpectNoError(e2enodekubelet.WriteKubeletConfigFile(newCfg))
134116

135-
ginkgo.By("Starting the kubelet")
136-
startKubelet()
117+
ginkgo.By("Restarting the kubelet")
118+
restartKubelet(true)
137119

138120
// wait until the kubelet health check will succeed
139-
gomega.Eventually(ctx, func() bool {
140-
return getNodeReadyStatus(ctx, f) && kubeletHealthCheck(kubeletHealthCheckURL)
141-
}).WithTimeout(2 * time.Minute).WithPolling(5 * time.Second).Should(gomega.BeTrueBecause("expected kubelet to be in healthy state"))
121+
gomega.Eventually(ctx, func(ctx context.Context) bool {
122+
return kubeletHealthCheck(kubeletHealthCheckURL)
123+
}).WithTimeout(2 * time.Minute).WithPolling(5 * time.Second).Should(gomega.BeTrue())
142124
ginkgo.By("Started the kubelet")
143125

144126
gomega.Consistently(ctx, func(ctx context.Context) bool {
145127
return getNodeReadyStatus(ctx, f) && kubeletHealthCheck(kubeletHealthCheckURL)
146-
}).WithTimeout(2 * time.Minute).WithPolling(2 * time.Second).Should(gomega.BeTrueBecause("node keeps reporting ready status"))
128+
}).WithTimeout(2 * time.Minute).WithPolling(2 * time.Second).Should(gomega.BeTrue())
147129
})
148130
})
149131
})

0 commit comments

Comments
 (0)