From 39c10c5c3ed59eb659848d30cc6b079d2e434bcb Mon Sep 17 00:00:00 2001 From: vikaschoudhary16 Date: Fri, 12 Apr 2019 10:37:54 +0530 Subject: [PATCH] Fix machinehealthcheck test --- .../machinehealthcheck/machinehealthcheck.go | 47 +++++++------------ 1 file changed, 16 insertions(+), 31 deletions(-) diff --git a/pkg/e2e/machinehealthcheck/machinehealthcheck.go b/pkg/e2e/machinehealthcheck/machinehealthcheck.go index abecd6853..a0cdacf39 100644 --- a/pkg/e2e/machinehealthcheck/machinehealthcheck.go +++ b/pkg/e2e/machinehealthcheck/machinehealthcheck.go @@ -104,46 +104,31 @@ var _ = Describe("[Feature:MachineHealthCheck] MachineHealthCheck controller", f glog.V(2).Infof("Create machine health check with label selector: %s", workerMachine.Labels) err = e2e.CreateMachineHealthCheck(workerMachine.Labels) Expect(err).ToNot(HaveOccurred()) - }) - Context("with node-unhealthy-conditions configmap", func() { - BeforeEach(func() { - unhealthyConditions := &conditions.UnhealthyConditions{ - Items: []conditions.UnhealthyCondition{ - { - Name: "Ready", - Status: "Unknown", - Timeout: "60s", - }, + unhealthyConditions := &conditions.UnhealthyConditions{ + Items: []conditions.UnhealthyCondition{ + { + Name: "Ready", + Status: "Unknown", + Timeout: "60s", }, - } - glog.V(2).Infof("Create node-unhealthy-conditions configmap") - err := e2e.CreateUnhealthyConditionsConfigMap(unhealthyConditions) - Expect(err).ToNot(HaveOccurred()) - }) + }, + } + glog.V(2).Infof("Create node-unhealthy-conditions configmap") + err = e2e.CreateUnhealthyConditionsConfigMap(unhealthyConditions) + Expect(err).ToNot(HaveOccurred()) + }) + Context("with node-unhealthy-conditions configmap", func() { It("should delete unhealthy machine", func() { - stopKubeletAndValidateMachineDeletion(workerNode, workerMachine, 2*time.Minute) + stopKubeletAndValidateMachineDeletion(workerNode, workerMachine, 6*time.Minute) }) - - AfterEach(func() { - glog.V(2).Infof("Delete node-unhealthy-conditions configmap") - err := e2e.DeleteUnhealthyConditionsConfigMap() - Expect(err).ToNot(HaveOccurred()) - }) - }) - - It("should delete unhealthy machine", func() { - stopKubeletAndValidateMachineDeletion(workerNode, workerMachine, 6*time.Minute) }) AfterEach(func() { - isKubemarkProvider, err := e2e.IsKubemarkProvider(client) + glog.V(2).Infof("Delete node-unhealthy-conditions configmap") + err := e2e.DeleteUnhealthyConditionsConfigMap() Expect(err).ToNot(HaveOccurred()) - if isKubemarkProvider { - glog.V(2).Info("Can not run this tests with the 'KubeMark' provider") - Skip("Can not run this tests with the 'KubeMark' provider") - } waitForWorkersToGetReady(numberOfReadyWorkers) deleteMachineHealthCheck(e2e.MachineHealthCheckName)