mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
Updating EndpointSliceMirroring e2e test to accept multiple slices
Due to informer caching, this caused some flaky test failures.
This commit is contained in:
parent
5937e7eef7
commit
2c7d186669
@ -79,11 +79,16 @@ var _ = SIGDescribe("EndpointSliceMirroring", func() {
|
|||||||
framework.Logf("Error listing EndpointSlices: %v", err)
|
framework.Logf("Error listing EndpointSlices: %v", err)
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
if len(esList.Items) != 1 {
|
if len(esList.Items) == 0 {
|
||||||
framework.Logf("Waiting for 1 EndpointSlice to exist, got %d", len(esList.Items))
|
framework.Logf("Waiting for at least 1 EndpointSlice to exist, got %d", len(esList.Items))
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
epSlice := esList.Items[0]
|
|
||||||
|
// 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 {
|
if len(epSlice.Ports) != 1 {
|
||||||
return false, fmt.Errorf("Expected EndpointSlice to have 1 Port, got %d", len(epSlice.Ports))
|
return false, fmt.Errorf("Expected EndpointSlice to have 1 Port, got %d", len(epSlice.Ports))
|
||||||
}
|
}
|
||||||
@ -102,6 +107,7 @@ var _ = SIGDescribe("EndpointSliceMirroring", func() {
|
|||||||
if address != "10.1.2.3" {
|
if address != "10.1.2.3" {
|
||||||
return false, fmt.Errorf("Expected EndpointSlice to have 10.1.2.3 as address, got %s", address)
|
return false, fmt.Errorf("Expected EndpointSlice to have 10.1.2.3 as address, got %s", address)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true, nil
|
return true, nil
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user