Skip to content

Commit

Permalink
e2e_node: use restart instead of start stop
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Hunt <pehunt@redhat.com>
  • Loading branch information
haircommander committed Oct 11, 2024
1 parent cc87438 commit b94c538
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions test/e2e_node/node_container_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,10 @@ var _ = SIGDescribe("Node Container Manager", framework.WithSerial(), func() {
ginkgo.DeferCleanup(func(ctx context.Context) {
if oldCfg != nil {
// Update the Kubelet configuration.
ginkgo.By("Stopping the kubelet")
startKubelet := stopKubelet()

// wait until the kubelet health check will fail
gomega.Eventually(ctx, func() bool {
return kubeletHealthCheck(kubeletHealthCheckURL)
}).WithTimeout(time.Minute).WithPolling(time.Second).Should(gomega.BeFalseBecause("expected kubelet health check to be failed"))
ginkgo.By("Stopped the kubelet")

framework.ExpectNoError(e2enodekubelet.WriteKubeletConfigFile(oldCfg))

ginkgo.By("Starting the kubelet")
startKubelet()
ginkgo.By("Restarting the kubelet")
restartKubelet(true)

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

// Update the Kubelet configuration.
ginkgo.By("Stopping the kubelet")
startKubelet := stopKubelet()

// wait until the kubelet health check will fail
gomega.Eventually(ctx, func() bool {
return kubeletHealthCheck(kubeletHealthCheckURL)
}).WithTimeout(time.Minute).WithPolling(time.Second).Should(gomega.BeFalseBecause("expected kubelet health check to be failed"))
ginkgo.By("Stopped the kubelet")

framework.ExpectNoError(e2enodekubelet.WriteKubeletConfigFile(newCfg))

ginkgo.By("Starting the kubelet")
startKubelet()
ginkgo.By("Restarting the kubelet")
restartKubelet(true)

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

Expand Down

0 comments on commit b94c538

Please sign in to comment.