Skip to content

Commit

Permalink
Use meaningful timeout vars
Browse files Browse the repository at this point in the history
Replace timeoutShort with timeoutTaint and timeoutAfterReboot
  • Loading branch information
razo7 committed Dec 27, 2023
1 parent 18bb842 commit 88e3ce1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/e2e/far_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ const (
//TODO: try to minimize timeout
// eventually parameters
timeoutLogs = "3m0s"
timeoutTaint = "2s" // this timeout is used for checking the FAR taint
timeoutReboot = "6m0s" // fencing with fence_aws should be completed within 6 minutes
timeoutShort = "5s" // this timeout is used after all the other steps have been succesfult
timeoutAfterReboot = "5s" // this timeout is used after all the other steps have been successful
pollShort = "250ms"
pollInterval = "1s"
)
Expand Down Expand Up @@ -297,7 +298,7 @@ func wasFarTaintAdded(nodeName string) {
node, err = utils.GetNodeWithName(k8sClient, nodeName)
g.Expect(err).ToNot(HaveOccurred())
return utils.TaintExists(node.Spec.Taints, &farTaint)
}, timeoutShort, pollShort).Should(BeTrue())
}, timeoutTaint, pollShort).Should(BeTrue())
log.Info("FAR taint was added", "node name", node.Name, "taint key", farTaint.Key, "taint effect", farTaint.Effect)
}

Expand Down Expand Up @@ -392,7 +393,7 @@ func checkPodDeleted(pod *corev1.Pod) {
newPod := &corev1.Pod{}
err := k8sClient.Get(context.Background(), client.ObjectKeyFromObject(pod), newPod)
return apiErrors.IsNotFound(err)
}, timeoutShort, pollShort).Should(BeTrue())
}, timeoutAfterReboot, pollShort).Should(BeTrue())
log.Info("Pod has already been deleted", "pod name", pod.Name)
}

Expand All @@ -409,7 +410,7 @@ func verifyStatusCondition(nodeName, conditionType string, conditionStatus *meta
g.Expect(condition).ToNot(BeNil(), "expected condition %v to be set", conditionType)
g.Expect(condition.Status).To(Equal(*conditionStatus), "expected condition %v to have status %v", conditionType, *conditionStatus)
}
}, timeoutShort, pollShort).Should(Succeed())
}, timeoutAfterReboot, pollShort).Should(Succeed())
}

// checkRemediation verify whether the node was remediated
Expand Down

0 comments on commit 88e3ce1

Please sign in to comment.