Rollback to Poll instead of PollImmediate
This commit is contained in:
parent
3d163e585a
commit
7fe5eccbc6
6 changed files with 28 additions and 27 deletions
|
|
@ -205,21 +205,21 @@ func (f *Framework) GetURL(scheme RequestScheme) string {
|
|||
|
||||
// WaitForNginxServer waits until the nginx configuration contains a particular server section
|
||||
func (f *Framework) WaitForNginxServer(name string, matcher func(cfg string) bool) {
|
||||
err := wait.PollImmediate(Poll, DefaultTimeout, f.matchNginxConditions(name, matcher))
|
||||
err := wait.Poll(Poll, DefaultTimeout, f.matchNginxConditions(name, matcher))
|
||||
assert.Nil(ginkgo.GinkgoT(), err, "waiting for nginx server condition/s")
|
||||
Sleep(1 * time.Second)
|
||||
}
|
||||
|
||||
// WaitForNginxConfiguration waits until the nginx configuration contains a particular configuration
|
||||
func (f *Framework) WaitForNginxConfiguration(matcher func(cfg string) bool) {
|
||||
err := wait.PollImmediate(Poll, DefaultTimeout, f.matchNginxConditions("", matcher))
|
||||
err := wait.Poll(Poll, DefaultTimeout, f.matchNginxConditions("", matcher))
|
||||
assert.Nil(ginkgo.GinkgoT(), err, "waiting for nginx server condition/s")
|
||||
Sleep(1 * time.Second)
|
||||
}
|
||||
|
||||
// WaitForNginxCustomConfiguration waits until the nginx configuration given part (from, to) contains a particular configuration
|
||||
func (f *Framework) WaitForNginxCustomConfiguration(from string, to string, matcher func(cfg string) bool) {
|
||||
err := wait.PollImmediate(Poll, DefaultTimeout, f.matchNginxCustomConditions(from, to, matcher))
|
||||
err := wait.Poll(Poll, DefaultTimeout, f.matchNginxCustomConditions(from, to, matcher))
|
||||
assert.Nil(ginkgo.GinkgoT(), err, "waiting for nginx server condition/s")
|
||||
}
|
||||
|
||||
|
|
@ -428,7 +428,7 @@ func (f *Framework) DeleteNGINXPod(grace int64) {
|
|||
err = f.KubeClientSet.CoreV1().Pods(ns).Delete(context.TODO(), pod.GetName(), *metav1.NewDeleteOptions(grace))
|
||||
assert.Nil(ginkgo.GinkgoT(), err, "deleting ingress nginx pod")
|
||||
|
||||
err = wait.PollImmediate(Poll, DefaultTimeout, func() (bool, error) {
|
||||
err = wait.Poll(Poll, DefaultTimeout, func() (bool, error) {
|
||||
pod, err := GetIngressNGINXPod(ns, f.KubeClientSet)
|
||||
if err != nil || pod == nil {
|
||||
return false, nil
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ func WaitForEndpoints(kubeClientSet kubernetes.Interface, timeout time.Duration,
|
|||
return nil
|
||||
}
|
||||
|
||||
return wait.PollImmediate(Poll, timeout, func() (bool, error) {
|
||||
return wait.Poll(Poll, timeout, func() (bool, error) {
|
||||
endpoint, err := kubeClientSet.CoreV1().Endpoints(ns).Get(context.TODO(), name, metav1.GetOptions{})
|
||||
if k8sErrors.IsNotFound(err) {
|
||||
return false, nil
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ func matchTLSServerName(url string, tlsConfig *tls.Config) wait.ConditionFunc {
|
|||
Logf("Unexpected TLS error: %v", err)
|
||||
return false, nil
|
||||
}
|
||||
conn.Close()
|
||||
defer conn.Close()
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ func CreateKubeNamespace(baseName string, c kubernetes.Interface) (string, error
|
|||
var got *corev1.Namespace
|
||||
var err error
|
||||
|
||||
err = wait.PollImmediate(Poll, DefaultTimeout, func() (bool, error) {
|
||||
err = wait.Poll(Poll, DefaultTimeout, func() (bool, error) {
|
||||
got, err = c.CoreV1().Namespaces().Create(context.TODO(), ns, metav1.CreateOptions{})
|
||||
if err != nil {
|
||||
Logf("Unexpected error while creating namespace: %v", err)
|
||||
|
|
@ -119,7 +119,7 @@ func deleteKubeNamespace(c kubernetes.Interface, namespace string) error {
|
|||
|
||||
// WaitForKubeNamespaceNotExist waits until a namespaces is not present in the cluster
|
||||
func WaitForKubeNamespaceNotExist(c kubernetes.Interface, namespace string) error {
|
||||
return wait.PollImmediate(Poll, DefaultTimeout, namespaceNotExist(c, namespace))
|
||||
return wait.Poll(Poll, DefaultTimeout, namespaceNotExist(c, namespace))
|
||||
}
|
||||
|
||||
func namespaceNotExist(c kubernetes.Interface, namespace string) wait.ConditionFunc {
|
||||
|
|
@ -137,7 +137,7 @@ func namespaceNotExist(c kubernetes.Interface, namespace string) wait.ConditionF
|
|||
|
||||
// WaitForNoPodsInNamespace waits until there are no pods running in a namespace
|
||||
func WaitForNoPodsInNamespace(c kubernetes.Interface, namespace string) error {
|
||||
return wait.PollImmediate(Poll, DefaultTimeout, noPodsInNamespace(c, namespace))
|
||||
return wait.Poll(Poll, DefaultTimeout, noPodsInNamespace(c, namespace))
|
||||
}
|
||||
|
||||
func noPodsInNamespace(c kubernetes.Interface, namespace string) wait.ConditionFunc {
|
||||
|
|
@ -167,12 +167,12 @@ func WaitForPodRunningInNamespace(c kubernetes.Interface, pod *corev1.Pod) error
|
|||
}
|
||||
|
||||
func waitTimeoutForPodRunningInNamespace(c kubernetes.Interface, podName, namespace string, timeout time.Duration) error {
|
||||
return wait.PollImmediate(Poll, DefaultTimeout, podRunning(c, podName, namespace))
|
||||
return wait.Poll(Poll, DefaultTimeout, podRunning(c, podName, namespace))
|
||||
}
|
||||
|
||||
// WaitForSecretInNamespace waits a default amount of time for the specified secret is present in a particular namespace
|
||||
func WaitForSecretInNamespace(c kubernetes.Interface, namespace, name string) error {
|
||||
return wait.PollImmediate(Poll, DefaultTimeout, secretInNamespace(c, namespace, name))
|
||||
return wait.Poll(Poll, DefaultTimeout, secretInNamespace(c, namespace, name))
|
||||
}
|
||||
|
||||
func secretInNamespace(c kubernetes.Interface, namespace, name string) wait.ConditionFunc {
|
||||
|
|
@ -194,7 +194,7 @@ func secretInNamespace(c kubernetes.Interface, namespace, name string) wait.Cond
|
|||
|
||||
// WaitForFileInFS waits a default amount of time for the specified file is present in the filesystem
|
||||
func WaitForFileInFS(file string) error {
|
||||
return wait.PollImmediate(Poll, DefaultTimeout, fileInFS(file))
|
||||
return wait.Poll(Poll, DefaultTimeout, fileInFS(file))
|
||||
}
|
||||
|
||||
func fileInFS(file string) wait.ConditionFunc {
|
||||
|
|
@ -218,7 +218,7 @@ func fileInFS(file string) wait.ConditionFunc {
|
|||
|
||||
// WaitForNoIngressInNamespace waits until there is no ingress object in a particular namespace
|
||||
func WaitForNoIngressInNamespace(c kubernetes.Interface, namespace, name string) error {
|
||||
return wait.PollImmediate(Poll, DefaultTimeout, noIngressInNamespace(c, namespace, name))
|
||||
return wait.Poll(Poll, DefaultTimeout, noIngressInNamespace(c, namespace, name))
|
||||
}
|
||||
|
||||
func noIngressInNamespace(c kubernetes.Interface, namespace, name string) wait.ConditionFunc {
|
||||
|
|
@ -240,7 +240,7 @@ func noIngressInNamespace(c kubernetes.Interface, namespace, name string) wait.C
|
|||
|
||||
// WaitForIngressInNamespace waits until a particular ingress object exists namespace
|
||||
func WaitForIngressInNamespace(c kubernetes.Interface, namespace, name string) error {
|
||||
return wait.PollImmediate(Poll, DefaultTimeout, ingressInNamespace(c, namespace, name))
|
||||
return wait.Poll(Poll, DefaultTimeout, ingressInNamespace(c, namespace, name))
|
||||
}
|
||||
|
||||
func ingressInNamespace(c kubernetes.Interface, namespace, name string) wait.ConditionFunc {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue