Code change:
framework.Logf("Error listing EndpointSlices: %v", err) return false, nil } <del> if len(esList.Items) != 1 { framework.Logf("Waiting for 1 EndpointSlice to exist, got %d", len(esList.Items)) </del> <ins> if len(esList.Items) == 0 { framework.Logf("Waiting for at least 1 EndpointSlice to exist, got %d", len(esList.Items)) </ins> return false, nil } <del> epSlice := esList.Items[0] if len(epSlice.Ports) != 1 { return false, fmt.Errorf("Expected EndpointSlice to have 1 Port, got %d", len(epSlice.Ports)) } port := epSlice.Ports[0] if *port.Port != int32(80) { return false, fmt.Errorf("Expected port to be 80, got %d", *port.Port) } if len(epSlice.Endpoints) != 1 { return false, fmt.Errorf("Expected EndpointSlice to have 1 endpoints, got %d", len(epSlice.Endpoints)) } endpoint := epSlice.Endpoints[0] if len(endpoint.Addresses) != 1 { return false, fmt.Errorf("Expected EndpointSlice endpoint to have 1 address, got %d", len(endpoint.Addresses)) } address := endpoint.Addresses[0] if address != "10.1.2.3" { return false, fmt.Errorf("Expected EndpointSlice to have 10.1.2.3 as address, got %s", address) </del> <ins> // Due to informer caching, it's possible for the controller // to create a second EndpointSlice if it does not see the // first EndpointSlice that was created during a sync. All // EndpointSlices created should be valid though. for _, epSlice := range esList.Items { if len(epSlice.Ports) != 1 { return false, fmt.Errorf("Expected EndpointSlice to have 1 Port, got %d", len(epSlice.Ports)) } port := epSlice.Ports[0] if *port.Port != int32(80) { return false, fmt.Errorf("Expected port to be 80, got %d", *port.Port) } if len(epSlice.Endpoints) != 1 { return false, fmt.Errorf("Expected EndpointSlice to have 1 endpoints, got %d", len(epSlice.Endpoints)) } endpoint := epSlice.Endpoints[0] if len(endpoint.Addresses) != 1 { return false, fmt.Errorf("Expected EndpointSlice endpoint to have 1 address, got %d", len(endpoint.Addresses)) } address := endpoint.Addresses[0] if address != "10.1.2.3" { return false, fmt.Errorf("Expected EndpointSlice to have 10.1.2.3 as address, got %s", address) } </ins> } return true, nil

Related discussion:
text: <!-- Please only use this template for submitting reports about flaky tests or jobs (pass or fail with no underlying change in code) in Kubernetes CI --Which jobs are flaking: Which test(s) are flaking: Testgrid link: Reason for failure: Anything else we need to know: /sig network <!-- Please see the deflaking doc () for more guidance! --
/triage unresolved Comment when the issue is assessed and confirmed. I am a bot run by vllry. ‍
/assign
Reviewing this as I code the CI Signal report No longer flaking on However, the test is flaking on other jobs as can be seen here Jobs affected ci-kubernetes-e2e-gce-cos-k8sbeta-default, ci-kubernetes-e2e-gce-multizone ci-kubernetes-e2e-gci-gce-containerd links to the flakes can be found in Triage link above Tentative Observation : No flaking results on jobs using kind but some flaking on gce jobs?? what would be the next best step to carry out for this? cc
Sorry I've been underwater for a bit. It looks like the test is expecting only one EndpointSlice to be created but sometimes an extra one is created due to informer cache being out of date. Although not ideal, this would still be a valid outcome. I need to update the test to consider this a valid outcome.
any updates on this?
Thanks for the reminder, filed to fix this.
/triage accepted