From aef2b1b2d0447b743cd4fa681d54f2a23bab8b0d Mon Sep 17 00:00:00 2001 From: Michael Weibel Date: Mon, 31 Aug 2026 14:49:17 +0200 Subject: [PATCH 1/2] improve test reliability for UDP health checks apply the same sleep as in TestServiceEndToEndUDP to increase reliability of this test. It failed relatively often in recent integration test runs. --- pkg/internal/integration/service_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/internal/integration/service_test.go b/pkg/internal/integration/service_test.go index 275648b..13bf0c5 100644 --- a/pkg/internal/integration/service_test.go +++ b/pkg/internal/integration/service_test.go @@ -735,6 +735,11 @@ func (s *IntegrationTestSuite) TestServiceEndToEndDualProtocol() { s.Require().Len(svc.Status.LoadBalancer.Ingress, 2) addr := svc.Status.LoadBalancer.Ingress[0].IP + // We have to wait a few seconds until the configured health monitor reports the services as up. + // Sleeping 9 seconds allows for at least 3 successful up probes, + // which is one more than required. + time.Sleep(3 * 3 * time.Second) + // Create custom resolver pointing to the DNS service resolver := &net.Resolver{ PreferGo: true, From 5103ef5512a2e195f5210af3cfcf387118c69afd Mon Sep 17 00:00:00 2001 From: Michael Weibel Date: Tue, 1 Sep 2026 12:27:32 +0200 Subject: [PATCH 2/2] stabilize after switching traffic policy --- pkg/internal/integration/service_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/internal/integration/service_test.go b/pkg/internal/integration/service_test.go index 13bf0c5..6471530 100644 --- a/pkg/internal/integration/service_test.go +++ b/pkg/internal/integration/service_test.go @@ -964,6 +964,9 @@ func (s *IntegrationTestSuite) TestServiceTrafficPolicyLocal() { // Now expect to see an IP address from the node's private network assertPrefix(addr, &local_policy_prefix) + // Allow the load balancer to stabilize after switching traffic policy. + // Without this, we may see connection resets during rapid assertions. + time.Sleep(5 * time.Second) assertFastResponses(addr, &local_policy_prefix) // Go back to the Cluster policy @@ -980,6 +983,9 @@ func (s *IntegrationTestSuite) TestServiceTrafficPolicyLocal() { s.Require().NotNil(service) assertPrefix(addr, &cluster_policy_prefix) + // Allow the load balancer to stabilize after switching traffic policy. + // Without this, we may see connection resets during rapid assertions. + time.Sleep(5 * time.Second) assertFastResponses(addr, &cluster_policy_prefix) }