Merge pull request #129754 from aojea/test_dual_slices

Fix dual stack tests after moving the e2e test to use Endpoint Slices
This commit is contained in:
Kubernetes Prow Robot 2025-01-22 04:48:37 -08:00 committed by GitHub
commit 71dc1e9e03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -863,10 +863,14 @@ func (config *NetworkingTestConfig) setup(ctx context.Context, selector map[stri
}
ginkgo.By("Waiting for NodePort service to expose endpoint")
err = framework.WaitForServiceEndpointsNum(ctx, config.f.ClientSet, config.Namespace, nodePortServiceName, len(config.EndpointPods), time.Second, wait.ForeverTestTimeout)
numEndpoints := len(config.EndpointPods)
if config.DualStackEnabled {
numEndpoints = 2 * len(config.EndpointPods)
}
err = framework.WaitForServiceEndpointsNum(ctx, config.f.ClientSet, config.Namespace, nodePortServiceName, numEndpoints, time.Second, wait.ForeverTestTimeout)
framework.ExpectNoError(err, "failed to validate endpoints for service %s in namespace: %s", nodePortServiceName, config.Namespace)
ginkgo.By("Waiting for Session Affinity service to expose endpoint")
err = framework.WaitForServiceEndpointsNum(ctx, config.f.ClientSet, config.Namespace, sessionAffinityServiceName, len(config.EndpointPods), time.Second, wait.ForeverTestTimeout)
err = framework.WaitForServiceEndpointsNum(ctx, config.f.ClientSet, config.Namespace, sessionAffinityServiceName, numEndpoints, time.Second, wait.ForeverTestTimeout)
framework.ExpectNoError(err, "failed to validate endpoints for service %s in namespace: %s", sessionAffinityServiceName, config.Namespace)
}
@ -916,7 +920,11 @@ func (config *NetworkingTestConfig) DeleteNetProxyPod(ctx context.Context) {
framework.Failf("Failed to delete %s pod: %v", pod.Name, err)
}
// wait for endpoint being removed.
err = framework.WaitForServiceEndpointsNum(ctx, config.f.ClientSet, config.Namespace, nodePortServiceName, len(config.EndpointPods), time.Second, wait.ForeverTestTimeout)
numEndpoints := len(config.EndpointPods)
if config.DualStackEnabled {
numEndpoints = 2 * len(config.EndpointPods)
}
err = framework.WaitForServiceEndpointsNum(ctx, config.f.ClientSet, config.Namespace, nodePortServiceName, numEndpoints, time.Second, wait.ForeverTestTimeout)
if err != nil {
framework.Failf("Failed to remove endpoint from service: %s", nodePortServiceName)
}