OCPBUGS-97822: test/router: retry http2 test when response comes from wrong router#31367
OCPBUGS-97822: test/router: retry http2 test when response comes from wrong router#31367mkowalski wants to merge 1 commit into
Conversation
The http2 test deploys a dedicated router shard with HTTP/2 enabled
and reaches it via the shard's wildcard DNS record
(*.<namespace>.apps.<cluster-domain>). Until that record propagates,
the route hostname still matches the cluster's *.apps wildcard (RFC
4592 wildcards match multiple labels), so requests are served by the
default router, which also admits the test routes but has HTTP/2
disabled by default.
Such a response carries the expected status code and body, so the
poll loop accepts it, and the subsequent protocol assertion fails
with HTTP/1.1 != HTTP/2.0 even though the shard would have served
the request correctly moments later.
This is visible as a flaky failure on 5.0 HyperShift AWS conformance
(Component Readiness regression #42853, ~20% failure rate,
consistently failing on the first test case with
'Expected HTTP/1.1 to equal HTTP/2.0'):
fail [.../test/extended/router/http2.go:513]:
{route:http2-custom-cert-edge frontendProto:HTTP/2.0 ...}
Expected <string>: HTTP/1.1 to equal <string>: HTTP/2.0
Fix by treating a response with an unexpected negotiated protocol or
body as retryable inside the poll loop. Also drop pooled keep-alive
connections before retrying so the next attempt re-resolves DNS and
opens a fresh TLS connection instead of being pinned to the wrong
router by the transport's connection pool.
Generated-by: AI
Signed-off-by: Mateusz Kowalski <mko@redhat.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
|
@mkowalski: This pull request explicitly references no jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
WalkthroughThis PR modifies the HTTP/2 router conformance test to read and store the response body during the polling loop rather than after it. Polling now retries on protocol or body content mismatches, and closes idle connections before retrying. Post-poll assertions use the stored body. ChangesHTTP/2 router test polling update
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mkowalski The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Filed https://issues.redhat.com/browse/OCPBUGS-97822 for this (Component Readiness regression 42853, release blocker). |
|
@mkowalski: This pull request references Jira Issue OCPBUGS-97822, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh |
|
@mkowalski: This pull request references Jira Issue OCPBUGS-97822, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Scheduling required tests: |
|
@mkowalski: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Problem
The http2 test deploys a dedicated router shard with HTTP/2 enabled (
ingress.operator.openshift.io/default-enable-http2: true) and reaches it via the shard's wildcard DNS record (*.<namespace>.apps.<cluster-domain>). Until that record propagates, the route hostname still matches the cluster's*.appswildcard (RFC 4592 wildcards match multiple labels), so requests are served by the default router, which also admits the test routes but has HTTP/2 disabled by default.Such a response carries the expected status code and body, so the poll loop accepts it, and the post-loop protocol assertion fails with
HTTP/1.1 != HTTP/2.0— even though the shard would have served the request correctly moments later.Evidence
Component Readiness regression #42853:
The HAProxy router should pass the http2 testsfailing at ~20% on 5.0 HyperShift AWS conformance (periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance) since 2026-06-27.9 of 10 sampled failures are identical and always on the first test case:
Status 200 + correct body + wrong protocol is exactly the signature of the default router (no h2) serving the request. The 10th failure is a plain DNS/LB propagation timeout at http2.go:509. The window likely widened on HyperShift with the
AWSServiceLBNetworkSecurityGrouppromotion (openshift/api#2838) changing shard LB provisioning latency, but the race itself has always been in the test.Fix
client.CloseIdleConnections()before retrying so the next attempt re-resolves DNS and opens a fresh TLS connection instead of being pinned to the wrong router by the transport's keep-alive pool.For test cases that legitimately expect HTTP/1.1 the check is a no-op on the happy path.
Generated-by: AI (analysis + patch), reviewed by mko@redhat.com
/cc @frobware
Summary by CodeRabbit