@@ -270,24 +270,11 @@ var BackendHealthCheckEventLogTest = suite.ConformanceTest{
270270 Test : func (t * testing.T , suite * suite.ConformanceTestSuite ) {
271271 ns := "gateway-conformance-infra"
272272 noHCRouteNN := types.NamespacedName {Name : "http-without-hc-event-log" , Namespace : ns }
273- hcRouteNN := types.NamespacedName {Name : "http-with-hc-event-log" , Namespace : ns }
274273 gwNN := types.NamespacedName {Name : "hc-event-log-gtw" , Namespace : ns }
275274
276275 gwAddr := kubernetes .GatewayAndHTTPRoutesMustBeAccepted (
277276 t , suite .Client , suite .TimeoutConfig , suite .ControllerName ,
278- kubernetes .NewGatewayRef (gwNN ), noHCRouteNN , hcRouteNN ,
279- )
280-
281- ancestorRef := gwapiv1.ParentReference {
282- Group : gatewayapi .GroupPtr (gwapiv1 .GroupName ),
283- Kind : gatewayapi .KindPtr (resource .KindGateway ),
284- Namespace : gatewayapi .NamespacePtr (gwNN .Namespace ),
285- Name : gwapiv1 .ObjectName (gwNN .Name ),
286- }
287- BackendTrafficPolicyMustBeAccepted (
288- t , suite .Client ,
289- types.NamespacedName {Name : "hc-event-log-btp" , Namespace : ns },
290- suite .ControllerName , ancestorRef ,
277+ kubernetes .NewGatewayRef (gwNN ), noHCRouteNN ,
291278 )
292279
293280 gatewayNS := GetGatewayResourceNamespace ()
@@ -297,10 +284,9 @@ var BackendHealthCheckEventLogTest = suite.ConformanceTest{
297284 "container" : "envoy" ,
298285 }
299286
300- // Phase 1: route without health checks — confirm no HC events exist yet.
287+ // Phase 1: only the no-HC route is live — no BTP means no health check
288+ // probes are running, so Loki must have zero HC events.
301289 t .Run ("no health check events before HC route is active" , func (t * testing.T ) {
302- // Send a few requests through the non-HC route to confirm it is reachable,
303- // then verify Loki has not recorded any HC events.
304290 http .MakeRequestAndExpectEventuallyConsistentResponse (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr , http.ExpectedResponse {
305291 Request : http.Request {Path : "/no-hc-event-log" },
306292 Response : http.Response {StatusCodes : []int {200 }},
@@ -312,7 +298,27 @@ var BackendHealthCheckEventLogTest = suite.ConformanceTest{
312298 require .Equal (t , 0 , count , "expected no HC events before HC-enabled route is active" )
313299 })
314300
315- // Phase 2: the HC-enabled route is already accepted; wait for events to appear.
301+ // Phase 2: apply the HC-enabled route and BTP, then wait for events.
302+ hcRouteNN := types.NamespacedName {Name : "http-with-hc-event-log" , Namespace : ns }
303+ suite .Applier .MustApplyWithCleanup (t , suite .Client , suite .TimeoutConfig , "testdata/backend-health-check-event-log-hc.yaml" , true )
304+
305+ kubernetes .GatewayAndHTTPRoutesMustBeAccepted (
306+ t , suite .Client , suite .TimeoutConfig , suite .ControllerName ,
307+ kubernetes .NewGatewayRef (gwNN ), hcRouteNN ,
308+ )
309+
310+ ancestorRef := gwapiv1.ParentReference {
311+ Group : gatewayapi .GroupPtr (gwapiv1 .GroupName ),
312+ Kind : gatewayapi .KindPtr (resource .KindGateway ),
313+ Namespace : gatewayapi .NamespacePtr (gwNN .Namespace ),
314+ Name : gwapiv1 .ObjectName (gwNN .Name ),
315+ }
316+ BackendTrafficPolicyMustBeAccepted (
317+ t , suite .Client ,
318+ types.NamespacedName {Name : "hc-event-log-btp" , Namespace : ns },
319+ suite .ControllerName , ancestorRef ,
320+ )
321+
316322 t .Run ("health check events appear in logs" , func (t * testing.T ) {
317323 http .AwaitConvergence (
318324 t ,
0 commit comments