Skip to content

Commit 71dc1e9

Browse files
authored
Merge pull request kubernetes#129754 from aojea/test_dual_slices
Fix dual stack tests after moving the e2e test to use Endpoint Slices
2 parents 0b14aad + db3ae75 commit 71dc1e9

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

test/e2e/framework/network/utils.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -863,10 +863,14 @@ func (config *NetworkingTestConfig) setup(ctx context.Context, selector map[stri
863863
}
864864

865865
ginkgo.By("Waiting for NodePort service to expose endpoint")
866-
err = framework.WaitForServiceEndpointsNum(ctx, config.f.ClientSet, config.Namespace, nodePortServiceName, len(config.EndpointPods), time.Second, wait.ForeverTestTimeout)
866+
numEndpoints := len(config.EndpointPods)
867+
if config.DualStackEnabled {
868+
numEndpoints = 2 * len(config.EndpointPods)
869+
}
870+
err = framework.WaitForServiceEndpointsNum(ctx, config.f.ClientSet, config.Namespace, nodePortServiceName, numEndpoints, time.Second, wait.ForeverTestTimeout)
867871
framework.ExpectNoError(err, "failed to validate endpoints for service %s in namespace: %s", nodePortServiceName, config.Namespace)
868872
ginkgo.By("Waiting for Session Affinity service to expose endpoint")
869-
err = framework.WaitForServiceEndpointsNum(ctx, config.f.ClientSet, config.Namespace, sessionAffinityServiceName, len(config.EndpointPods), time.Second, wait.ForeverTestTimeout)
873+
err = framework.WaitForServiceEndpointsNum(ctx, config.f.ClientSet, config.Namespace, sessionAffinityServiceName, numEndpoints, time.Second, wait.ForeverTestTimeout)
870874
framework.ExpectNoError(err, "failed to validate endpoints for service %s in namespace: %s", sessionAffinityServiceName, config.Namespace)
871875
}
872876

@@ -916,7 +920,11 @@ func (config *NetworkingTestConfig) DeleteNetProxyPod(ctx context.Context) {
916920
framework.Failf("Failed to delete %s pod: %v", pod.Name, err)
917921
}
918922
// wait for endpoint being removed.
919-
err = framework.WaitForServiceEndpointsNum(ctx, config.f.ClientSet, config.Namespace, nodePortServiceName, len(config.EndpointPods), time.Second, wait.ForeverTestTimeout)
923+
numEndpoints := len(config.EndpointPods)
924+
if config.DualStackEnabled {
925+
numEndpoints = 2 * len(config.EndpointPods)
926+
}
927+
err = framework.WaitForServiceEndpointsNum(ctx, config.f.ClientSet, config.Namespace, nodePortServiceName, numEndpoints, time.Second, wait.ForeverTestTimeout)
920928
if err != nil {
921929
framework.Failf("Failed to remove endpoint from service: %s", nodePortServiceName)
922930
}

0 commit comments

Comments
 (0)