From beef6ae51245515ed9c68090b9288d986a882c7b Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Wed, 23 Sep 2020 22:53:08 +0200 Subject: [PATCH] e2e tests must consider duplicate endpoint slices In some cases the EndpointSlice controller will create more EndpointSlices than necessary resulting in some duplication. This is valid and tests should only fail here if less EndpointSlices than expected are added. --- test/e2e/network/endpointslice.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/e2e/network/endpointslice.go b/test/e2e/network/endpointslice.go index 181e5cc72bd..b2586e9b2c0 100644 --- a/test/e2e/network/endpointslice.go +++ b/test/e2e/network/endpointslice.go @@ -521,7 +521,11 @@ func hasMatchingEndpointSlices(cs clientset.Interface, ns, svcName string, numEn for _, endpointSlice := range esList.Items { actualNumEndpoints += len(endpointSlice.Endpoints) } - if actualNumEndpoints != numEndpoints { + // In some cases the EndpointSlice controller will create more + // EndpointSlices than necessary resulting in some duplication. This is + // valid and tests should only fail here if less EndpointSlices than + // expected are added. + if actualNumEndpoints < numEndpoints { framework.Logf("EndpointSlices for %s/%s Service have %d/%d endpoints", ns, svcName, actualNumEndpoints, numEndpoints) return esList.Items, false }