Skip to content

Commit 3168803

Browse files
oilbeaterclaude
andauthored
test(e2e): optimize test execution time by reducing unnecessary waits (#6369)
* test(e2e): optimize test execution time by reducing unnecessary waits - Reduce global poll interval from 2s to 1s for faster resource readiness detection - Fix WaitUntil ignoring its interval parameter (was hardcoded to 2s) - Reduce disaster test sleep from 60s to 5s (process STOP/CONT simulation) - Reduce nc timeout from 5s to 2s in NAT policy external access checks - Add PeriodSeconds:1 and FailureThreshold:1 to VPC pod probe tests - Skip redundant StatefulSet IPPool iterations (replicas 1,2) and test only replicas=3 - Parallelize NAT policy ipset/iptables checks across nodes Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test(e2e): unify poll interval to 1s and reduce pod termination grace period Replace all 150 hardcoded 2*time.Second poll intervals with the framework poll constant (1s) or time.Second for files outside the framework package. Also reduce TerminationGracePeriodSeconds from 3 to 1 for pods and add it to StatefulSets to speed up teardown. Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> * test(e2e): fix deployment termination grace period and remaining poll intervals - Add TerminationGracePeriodSeconds=1 to MakeDeployment, consistent with MakePod and MakeStatefulSet. Without this, deployment pods use the default 30s grace period, slowing down all deployment-based tests. - Reduce checkIPSetOnNode poll interval from 3s to 1s to match the unified poll standard. - Reduce waitForInterfaceState poll interval from 5s to 1s to match the unified poll standard. Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> * test(e2e): parallelize AfterEach cleanup to reduce test execution time Restructure AfterEach blocks in 8 test files to delete resources in parallel within the same dependency level, then wait for all to disappear before proceeding to the next level. This reduces cleanup time from N × single-resource-time to max(single-resource-time) per level. Add PodClient.DeleteGracefully() method that initiates pod deletion with a 1-second grace period without blocking, enabling parallel pod cleanup alongside other resource types. Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> * test(e2e): fix node update conflict in nodeSelector underlay test Use retry.RetryOnConflict to wrap node label update operations to handle 409 Conflict errors caused by stale resourceVersion when concurrent controllers modify the node between Get and Update. Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> * test(e2e): fix deployment ippool test race condition with terminating pods GetPodsForDeployment() does not filter out pods with DeletionTimestamp, so when pods are deleted and recreated within the same ReplicaSet, both old (terminating) and new (running) pods are returned, causing "expect 3 but got 6" failures. Fix by using DeleteGracefully (1s grace period) and explicitly waiting for old pods to be fully removed before checking new pod count. Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> * test(e2e): fix Restart() 409 conflict by retrying with fresh resourceVersion Wrap Deployment and DaemonSet Restart() with retry.RetryOnConflict to handle 409 Conflict errors caused by concurrent controller status updates between Get and Update. Each retry fetches the latest object to ensure a current resourceVersion. Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 605d615 commit 3168803

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+462
-344
lines changed

test/e2e/anp-domain/e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ var _ = framework.SerialDescribe("[group:admin-network-policy]", func() {
111111
}
112112

113113
testNetworkConnectivity := func(target string, shouldSucceed bool, description string) {
114-
testNetworkConnectivityWithRetry(target, shouldSucceed, description, 20, 2*time.Second)
114+
testNetworkConnectivityWithRetry(target, shouldSucceed, description, 20, time.Second)
115115
}
116116

117117
framework.ConformanceIt("should create ANP with domainName deny rule and verify connectivity behavior", func() {

test/e2e/cnp-domain/e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ var _ = framework.SerialDescribe("[group:cluster-network-policy]", func() {
128128
dnsClient := f.DNSNameResolverClient()
129129
labelSelector := fmt.Sprintf("anp=%s", name)
130130

131-
framework.WaitUntil(2*time.Second, 30*time.Second, func(_ context.Context) (bool, error) {
131+
framework.WaitUntil(time.Second, 30*time.Second, func(_ context.Context) (bool, error) {
132132
resolverList := dnsClient.ListByLabel(labelSelector)
133133
if len(resolverList.Items) < expectedCount {
134134
framework.Logf("Found %d/%d DNSNameResolver(s) for CNP %s", len(resolverList.Items), expectedCount, name)

test/e2e/connectivity/e2e_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ var _ = framework.OrderedDescribe("[group:disaster]", func() {
255255

256256
ginkgo.By("Waiting for newly created ovs-ovn pod running on node " + suiteCtx.Node)
257257
pod = nil
258-
framework.WaitUntil(2*time.Second, 2*time.Minute, func(_ context.Context) (bool, error) {
258+
framework.WaitUntil(time.Second, 2*time.Minute, func(_ context.Context) (bool, error) {
259259
ds = dsClient.Get("ovs-ovn")
260260
pods, err = dsClient.GetPods(ds)
261261
if err != nil {
@@ -329,8 +329,8 @@ var _ = framework.OrderedDescribe("[group:disaster]", func() {
329329
framework.ExpectNoError(err, "failed to send STOP signal to ovn sb process: %v, %s", err, string(stderr))
330330
}
331331

332-
ginkgo.By("Waiting 60s")
333-
time.Sleep(60 * time.Second)
332+
ginkgo.By("Waiting 5s for process outage simulation")
333+
time.Sleep(5 * time.Second)
334334

335335
for _, pod := range pods.Items {
336336
ginkgo.By("Getting ovn sb pid of pod " + pod.Name + " running on " + pod.Spec.NodeName)
@@ -380,8 +380,8 @@ var _ = framework.OrderedDescribe("[group:disaster]", func() {
380380
_, stderr, err = framework.KubectlExec(pod.Namespace, pod.Name, cmd...)
381381
framework.ExpectNoError(err, "failed to send STOP signal to ovn-controller process: %v, %s", err, string(stderr))
382382

383-
ginkgo.By("Waiting 60s")
384-
time.Sleep(60 * time.Second)
383+
ginkgo.By("Waiting 5s for process outage simulation")
384+
time.Sleep(5 * time.Second)
385385

386386
ginkgo.By("Continuing the stopped ovn-controller process by sending a CONT signal")
387387
cmd = []string{"sh", "-c", fmt.Sprintf(`"kill -CONT %s"`, pid)}
@@ -422,8 +422,8 @@ var _ = framework.OrderedDescribe("[group:disaster]", func() {
422422
_, stderr, err = framework.KubectlExec(pod.Namespace, pod.Name, cmd...)
423423
framework.ExpectNoError(err, "failed to send STOP signal to ovs-vswitchd process: %v, %s", err, string(stderr))
424424

425-
ginkgo.By("Waiting 60s")
426-
time.Sleep(60 * time.Second)
425+
ginkgo.By("Waiting 5s for process outage simulation")
426+
time.Sleep(5 * time.Second)
427427

428428
ginkgo.By("Continuing the stopped ovs-vswitchd process by sending a CONT signal")
429429
cmd = []string{"sh", "-c", fmt.Sprintf(`"kill -CONT %s"`, pid)}

test/e2e/framework/daemonset.go

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"errors"
77
"fmt"
88
"strings"
9-
"time"
109

1110
appsv1 "k8s.io/api/apps/v1"
1211
corev1 "k8s.io/api/core/v1"
@@ -17,6 +16,7 @@ import (
1716
"k8s.io/apimachinery/pkg/util/wait"
1817
clientset "k8s.io/client-go/kubernetes"
1918
v1apps "k8s.io/client-go/kubernetes/typed/apps/v1"
19+
"k8s.io/client-go/util/retry"
2020
"k8s.io/kubectl/pkg/polymorphichelpers"
2121

2222
"github.com/onsi/ginkgo/v2"
@@ -100,7 +100,7 @@ func (c *DaemonSetClient) Patch(daemonset *appsv1.DaemonSet) *appsv1.DaemonSet {
100100
}
101101
ExpectNoError(err)
102102
var patchedDaemonSet *appsv1.DaemonSet
103-
err = wait.PollUntilContextTimeout(context.Background(), 2*time.Second, timeout, true, func(ctx context.Context) (bool, error) {
103+
err = wait.PollUntilContextTimeout(context.Background(), poll, timeout, true, func(ctx context.Context) (bool, error) {
104104
daemonSet, err := c.DaemonSetInterface.Patch(ctx, daemonset.Name, types.MergePatchType, modifiedBytes, metav1.PatchOptions{}, "")
105105
if err != nil {
106106
return handleWaitingAPIError(err, false, "patch daemonset %s/%s", daemonset.Namespace, daemonset.Name)
@@ -130,7 +130,7 @@ func (c *DaemonSetClient) RolloutStatus(name string) *appsv1.DaemonSet {
130130
ginkgo.GinkgoHelper()
131131

132132
var daemonSet *appsv1.DaemonSet
133-
WaitUntil(2*time.Second, timeout, func(_ context.Context) (bool, error) {
133+
WaitUntil(poll, timeout, func(_ context.Context) (bool, error) {
134134
var err error
135135
daemonSet = c.Get(name)
136136
unstructured := &unstructured.Unstructured{}
@@ -158,21 +158,31 @@ func (c *DaemonSetClient) RolloutStatus(name string) *appsv1.DaemonSet {
158158
func (c *DaemonSetClient) Restart(ds *appsv1.DaemonSet) *appsv1.DaemonSet {
159159
ginkgo.GinkgoHelper()
160160

161-
buf, err := polymorphichelpers.ObjectRestarterFn(ds)
162-
ExpectNoError(err)
161+
var result *appsv1.DaemonSet
162+
err := retry.RetryOnConflict(retry.DefaultBackoff, func() error {
163+
latest := c.Get(ds.Name)
163164

164-
m := make(map[string]any)
165-
err = json.Unmarshal(buf, &m)
166-
ExpectNoError(err)
165+
buf, err := polymorphichelpers.ObjectRestarterFn(latest)
166+
if err != nil {
167+
return err
168+
}
167169

168-
ds = new(appsv1.DaemonSet)
169-
err = runtime.DefaultUnstructuredConverter.FromUnstructured(m, ds)
170-
ExpectNoError(err)
170+
m := make(map[string]any)
171+
if err = json.Unmarshal(buf, &m); err != nil {
172+
return err
173+
}
174+
175+
d := new(appsv1.DaemonSet)
176+
if err = runtime.DefaultUnstructuredConverter.FromUnstructured(m, d); err != nil {
177+
return err
178+
}
171179

172-
ds, err = c.Update(context.TODO(), ds, metav1.UpdateOptions{})
180+
result, err = c.Update(context.TODO(), d, metav1.UpdateOptions{})
181+
return err
182+
})
173183
ExpectNoError(err)
174184

175-
return ds.DeepCopy()
185+
return result.DeepCopy()
176186
}
177187

178188
// RestartSync restarts the DaemonSet and wait it to be ready

test/e2e/framework/deployment.go

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"k8s.io/apimachinery/pkg/util/wait"
1919
clientset "k8s.io/client-go/kubernetes"
2020
v1apps "k8s.io/client-go/kubernetes/typed/apps/v1"
21+
"k8s.io/client-go/util/retry"
2122
"k8s.io/kubectl/pkg/polymorphichelpers"
2223
"k8s.io/kubernetes/test/e2e/framework"
2324
"k8s.io/kubernetes/test/e2e/framework/deployment"
@@ -98,7 +99,7 @@ func (c *DeploymentClient) RolloutStatus(name string) *appsv1.Deployment {
9899
ginkgo.GinkgoHelper()
99100

100101
var deploy *appsv1.Deployment
101-
WaitUntil(2*time.Second, timeout, func(_ context.Context) (bool, error) {
102+
WaitUntil(poll, timeout, func(_ context.Context) (bool, error) {
102103
var err error
103104
deploy = c.Get(name)
104105
unstructured := &unstructured.Unstructured{}
@@ -129,7 +130,7 @@ func (c *DeploymentClient) Patch(original, modified *appsv1.Deployment) *appsv1.
129130
ExpectNoError(err)
130131

131132
var patchedDeploy *appsv1.Deployment
132-
err = wait.PollUntilContextTimeout(context.Background(), 2*time.Second, timeout, true, func(ctx context.Context) (bool, error) {
133+
err = wait.PollUntilContextTimeout(context.Background(), poll, timeout, true, func(ctx context.Context) (bool, error) {
133134
deploy, err := c.DeploymentInterface.Patch(ctx, original.Name, types.StrategicMergePatchType, patch, metav1.PatchOptions{}, "")
134135
if err != nil {
135136
return handleWaitingAPIError(err, false, "patch deployment %s/%s", original.Namespace, original.Name)
@@ -159,21 +160,31 @@ func (c *DeploymentClient) PatchSync(original, modified *appsv1.Deployment) *app
159160
func (c *DeploymentClient) Restart(deploy *appsv1.Deployment) *appsv1.Deployment {
160161
ginkgo.GinkgoHelper()
161162

162-
buf, err := polymorphichelpers.ObjectRestarterFn(deploy)
163-
ExpectNoError(err)
163+
var result *appsv1.Deployment
164+
err := retry.RetryOnConflict(retry.DefaultBackoff, func() error {
165+
latest := c.Get(deploy.Name)
164166

165-
m := make(map[string]any)
166-
err = json.Unmarshal(buf, &m)
167-
ExpectNoError(err)
167+
buf, err := polymorphichelpers.ObjectRestarterFn(latest)
168+
if err != nil {
169+
return err
170+
}
168171

169-
deploy = new(appsv1.Deployment)
170-
err = runtime.DefaultUnstructuredConverter.FromUnstructured(m, deploy)
171-
ExpectNoError(err)
172+
m := make(map[string]any)
173+
if err = json.Unmarshal(buf, &m); err != nil {
174+
return err
175+
}
176+
177+
d := new(appsv1.Deployment)
178+
if err = runtime.DefaultUnstructuredConverter.FromUnstructured(m, d); err != nil {
179+
return err
180+
}
172181

173-
deploy, err = c.Update(context.TODO(), deploy, metav1.UpdateOptions{})
182+
result, err = c.Update(context.TODO(), d, metav1.UpdateOptions{})
183+
return err
184+
})
174185
ExpectNoError(err)
175186

176-
return deploy.DeepCopy()
187+
return result.DeepCopy()
177188
}
178189

179190
// RestartSync restarts the deployment and wait it to be ready
@@ -212,11 +223,11 @@ func (c *DeploymentClient) Delete(name string) {
212223
func (c *DeploymentClient) DeleteSync(name string) {
213224
ginkgo.GinkgoHelper()
214225
c.Delete(name)
215-
gomega.Expect(c.WaitToDisappear(name, 2*time.Second, timeout)).To(gomega.Succeed(), "wait for deployment %q to disappear", name)
226+
gomega.Expect(c.WaitToDisappear(name, poll, timeout)).To(gomega.Succeed(), "wait for deployment %q to disappear", name)
216227
}
217228

218229
func (c *DeploymentClient) WaitToComplete(deploy *appsv1.Deployment) error {
219-
return testutils.WaitForDeploymentComplete(c.clientSet, deploy, Logf, 2*time.Second, 2*time.Minute)
230+
return testutils.WaitForDeploymentComplete(c.clientSet, deploy, Logf, poll, 2*time.Minute)
220231
}
221232

222233
// WaitToDisappear waits the given timeout duration for the specified deployment to disappear.
@@ -238,5 +249,6 @@ func MakeDeployment(name string, replicas int32, podLabels, podAnnotations map[s
238249
deploy := deployment.NewDeployment(name, replicas, podLabels, containerName, image, strategyType)
239250
deploy.Spec.Template.Annotations = podAnnotations
240251
deploy.Spec.Template.Spec.Containers[0].ImagePullPolicy = corev1.PullIfNotPresent
252+
deploy.Spec.Template.Spec.TerminationGracePeriodSeconds = new(int64(1))
241253
return deploy
242254
}

test/e2e/framework/dns-name-resolver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func (c *DNSNameResolverClient) WaitToBeReady(name string, timeout time.Duration
6363
result := c.WaitUntil(name, func(dnsNameResolver *apiv1.DNSNameResolver) (bool, error) {
6464
// DNSNameResolver is considered ready if it has at least one resolved name
6565
return len(dnsNameResolver.Status.ResolvedNames) > 0, nil
66-
}, "Ready", 2*time.Second, timeout)
66+
}, "Ready", poll, timeout)
6767
return result != nil
6868
}
6969

test/e2e/framework/endpoints.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (c *EndpointsClient) Create(endpoints *corev1.Endpoints) *corev1.Endpoints
5858
func (c *EndpointsClient) CreateSync(endpoints *corev1.Endpoints, cond func(s *corev1.Endpoints) (bool, error), condDesc string) *corev1.Endpoints {
5959
ginkgo.GinkgoHelper()
6060
_ = c.Create(endpoints)
61-
return c.WaitUntil(endpoints.Name, cond, condDesc, 2*time.Second, timeout)
61+
return c.WaitUntil(endpoints.Name, cond, condDesc, poll, timeout)
6262
}
6363

6464
// Patch patches the endpoints
@@ -69,7 +69,7 @@ func (c *EndpointsClient) Patch(original, modified *corev1.Endpoints) *corev1.En
6969
ExpectNoError(err)
7070

7171
var patchedEndpoints *corev1.Endpoints
72-
err = wait.PollUntilContextTimeout(context.Background(), 2*time.Second, timeout, true, func(_ context.Context) (bool, error) {
72+
err = wait.PollUntilContextTimeout(context.Background(), poll, timeout, true, func(_ context.Context) (bool, error) {
7373
s, err := c.EndpointsInterface.Patch(context.TODO(), original.Name, types.MergePatchType, patch, metav1.PatchOptions{}, "")
7474
if err != nil {
7575
return handleWaitingAPIError(err, false, "patch endpoints %q", original.Name)
@@ -93,7 +93,7 @@ func (c *EndpointsClient) Patch(original, modified *corev1.Endpoints) *corev1.En
9393
func (c *EndpointsClient) PatchSync(original, modified *corev1.Endpoints, cond func(s *corev1.Endpoints) (bool, error), condDesc string) *corev1.Endpoints {
9494
ginkgo.GinkgoHelper()
9595
_ = c.Patch(original, modified)
96-
return c.WaitUntil(original.Name, cond, condDesc, 2*time.Second, timeout)
96+
return c.WaitUntil(original.Name, cond, condDesc, poll, timeout)
9797
}
9898

9999
// Delete deletes an Endpoints resource if it exists
@@ -110,15 +110,15 @@ func (c *EndpointsClient) Delete(name string) {
110110
func (c *EndpointsClient) DeleteSync(name string) {
111111
ginkgo.GinkgoHelper()
112112
c.Delete(name)
113-
gomega.Expect(c.WaitToDisappear(name, 2*time.Second, timeout)).To(gomega.Succeed(), "wait for endpoints %q to disappear", name)
113+
gomega.Expect(c.WaitToDisappear(name, poll, timeout)).To(gomega.Succeed(), "wait for endpoints %q to disappear", name)
114114
}
115115

116116
// WaitUntil waits the given timeout duration for the specified condition to be met.
117117
func (c *EndpointsClient) WaitUntil(name string, cond func(s *corev1.Endpoints) (bool, error), condDesc string, _, timeout time.Duration) *corev1.Endpoints {
118118
ginkgo.GinkgoHelper()
119119

120120
var endpoints *corev1.Endpoints
121-
err := wait.PollUntilContextTimeout(context.Background(), 2*time.Second, timeout, true, func(_ context.Context) (bool, error) {
121+
err := wait.PollUntilContextTimeout(context.Background(), poll, timeout, true, func(_ context.Context) (bool, error) {
122122
Logf("Waiting for endpoints %s to meet condition %q", name, condDesc)
123123
endpoints = c.Get(name).DeepCopy()
124124
met, err := cond(endpoints)

test/e2e/framework/framework.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const (
3838

3939
const (
4040
// poll is how often to Poll resources.
41-
poll = 2 * time.Second
41+
poll = time.Second
4242

4343
timeout = 2 * time.Minute
4444
)

test/e2e/framework/ip.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (c *IPClient) Patch(original, modified *apiv1.IP, timeout time.Duration) *a
8181
ExpectNoError(err)
8282

8383
var patchedIP *apiv1.IP
84-
err = wait.PollUntilContextTimeout(context.Background(), 2*time.Second, timeout, true, func(ctx context.Context) (bool, error) {
84+
err = wait.PollUntilContextTimeout(context.Background(), poll, timeout, true, func(ctx context.Context) (bool, error) {
8585
p, err := c.IPInterface.Patch(ctx, original.Name, types.MergePatchType, patch, metav1.PatchOptions{}, "")
8686
if err != nil {
8787
return handleWaitingAPIError(err, false, "patch IP %q", original.Name)
@@ -115,7 +115,7 @@ func (c *IPClient) Delete(name string) {
115115
func (c *IPClient) DeleteSync(name string) {
116116
ginkgo.GinkgoHelper()
117117
c.Delete(name)
118-
gomega.Expect(c.WaitToDisappear(name, 2*time.Second, timeout)).To(gomega.Succeed(), "wait for ovn eip %q to disappear", name)
118+
gomega.Expect(c.WaitToDisappear(name, poll, timeout)).To(gomega.Succeed(), "wait for ovn eip %q to disappear", name)
119119
}
120120

121121
// WaitToDisappear waits the given timeout duration for the specified IP to disappear.

test/e2e/framework/ippool.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (c *IPPoolClient) Update(ippool *apiv1.IPPool, options metav1.UpdateOptions
6464
ginkgo.GinkgoHelper()
6565

6666
var updatedIPPool *apiv1.IPPool
67-
err := wait.PollUntilContextTimeout(context.Background(), 2*time.Second, timeout, true, func(ctx context.Context) (bool, error) {
67+
err := wait.PollUntilContextTimeout(context.Background(), poll, timeout, true, func(ctx context.Context) (bool, error) {
6868
s, err := c.IPPoolInterface.Update(ctx, ippool, options)
6969
if err != nil {
7070
// On conflict, refresh the resource and retry
@@ -113,7 +113,7 @@ func (c *IPPoolClient) Patch(original, modified *apiv1.IPPool, timeout time.Dura
113113
ExpectNoError(err)
114114

115115
var patchedIPPool *apiv1.IPPool
116-
err = wait.PollUntilContextTimeout(context.Background(), 2*time.Second, timeout, true, func(ctx context.Context) (bool, error) {
116+
err = wait.PollUntilContextTimeout(context.Background(), poll, timeout, true, func(ctx context.Context) (bool, error) {
117117
s, err := c.IPPoolInterface.Patch(ctx, original.Name, types.MergePatchType, patch, metav1.PatchOptions{}, "")
118118
if err != nil {
119119
return handleWaitingAPIError(err, false, "patch ippool %q", original.Name)
@@ -158,7 +158,7 @@ func (c *IPPoolClient) Delete(name string) {
158158
func (c *IPPoolClient) DeleteSync(name string) {
159159
ginkgo.GinkgoHelper()
160160
c.Delete(name)
161-
gomega.Expect(c.WaitToDisappear(name, 2*time.Second, timeout)).To(gomega.Succeed(), "wait for ippool %q to disappear", name)
161+
gomega.Expect(c.WaitToDisappear(name, poll, timeout)).To(gomega.Succeed(), "wait for ippool %q to disappear", name)
162162
}
163163

164164
func isIPPoolConditionSetAsExpected(ippool *apiv1.IPPool, conditionType apiv1.ConditionType, wantTrue, silent bool) bool {

0 commit comments

Comments
 (0)