Skip to content

Commit 06331ac

Browse files
authored
Merge pull request kubernetes#129775 from aojea/blame_allocator
Blame allocator
2 parents 2334b84 + fdebfb4 commit 06331ac

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/e2e/network/service.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4118,6 +4118,22 @@ var _ = common.SIGDescribe("Services", func() {
41184118
// Request the same healthCheckNodePort as before, to test the user-requested allocation path
41194119
svc.Spec.HealthCheckNodePort = oldHealthCheckNodePort
41204120
})
4121+
if err != nil {
4122+
// We added a global static nodeport allocator to synchronize across tests and avoid other tests stealing the NodePort of this test and make it flake.
4123+
// Log the offending Service so we identify easily the problematic test.
4124+
// Dump all the IPs and look for the ones we want.
4125+
list, _ := cs.CoreV1().Services(metav1.NamespaceAll).List(ctx, metav1.ListOptions{})
4126+
for _, svc := range list.Items {
4127+
if svc.Spec.HealthCheckNodePort == oldHealthCheckNodePort {
4128+
framework.Failf("Service %#v stole NodePort from current test, please ensure that test is using the Static NodePort Allocator https://github.com/kubernetes/kubernetes/pull/127153 : %v", svc, err)
4129+
}
4130+
for _, port := range svc.Spec.Ports {
4131+
if port.NodePort == oldHealthCheckNodePort {
4132+
framework.Failf("Service %#v stole NodePort from current test, please ensure that test is using the Static NodePort Allocator https://github.com/kubernetes/kubernetes/pull/127153 : %v", svc, err)
4133+
}
4134+
}
4135+
}
4136+
}
41214137
framework.ExpectNoError(err, "updating ExternalTrafficPolicy and HealthCheckNodePort")
41224138
deadline = time.Now().Add(e2eservice.KubeProxyEndpointLagTimeout)
41234139

0 commit comments

Comments
 (0)