Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/e2e/gateway: check service as part of request condition #6251

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

skriss
Copy link
Member

@skriss skriss commented Mar 6, 2024

For the RequestHeaderModifierBackendRef test, check the service reached by the request as part of the
eventual consistency condition to avoid issues with test pollution.

ref. https://github.com/projectcontour/contour/actions/runs/8179127307/job/22364621818

Oddly, when failing, the request is hitting an "echo" backend pod, which isn't even defined as part of the test in question (it only has "echo-header-filter" and "echo-header-nofilter"). There must be some pollution going on from another test, but I can't spot it. It's a little odd given that the HTTPRoute has a distinct hostname that's being used in the requests. In any case, I think this should help avoid issues. Haven't been able to repro locally.

For the RequestHeaderModifierBackendRef test, check
the service reached by the request as part of the
eventual consistency condition to avoid issues with
test pollution.

Signed-off-by: Steve Kriss <stephen.kriss@gmail.com>
@skriss skriss added the release-note/none-required Marks a PR as not requiring a release note. Should only be used for very small changes. label Mar 6, 2024
@skriss skriss requested a review from a team as a code owner March 6, 2024 22:39
@skriss skriss requested review from tsaarni and sunjayBhatia and removed request for a team March 6, 2024 22:39
@sunjayBhatia sunjayBhatia requested review from a team, izturn and clayton-gonsalves and removed request for a team March 6, 2024 22:40
Copy link

codecov bot commented Mar 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.33%. Comparing base (e64a50a) to head (21d4562).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #6251   +/-   ##
=======================================
  Coverage   81.33%   81.33%           
=======================================
  Files         133      133           
  Lines       15775    15775           
=======================================
  Hits        12831    12831           
  Misses       2650     2650           
  Partials      294      294           

@sunjayBhatia
Copy link
Member

hm, one hint in the logs from the linked test run is:

time="2024-03-06T21:52:05Z" level=debug msg="nodeID \"contour\" requested type.googleapis.com/envoy.config.route.v3.RouteConfiguration[https-443/*.wildcardhost.gateway.projectcontour.io] and known map[https-443/*.wildcardhost.gateway.projectcontour.io:{}]. Diff []" context=defaultCache

which would mean the failing test runs after this one:

Hostnames: []gatewayapi_v1.Hostname{"*.wildcardhost.gateway.projectcontour.io"},

curiously that test passes making HTTPS requests as expected, but I wonder if the failures in testRequestHeaderModifierBackendRef with plain HTTP request pollution point to an issue with the wildcard route

@sunjayBhatia
Copy link
Member

hm, one hint in the logs from the linked test run is:

time="2024-03-06T21:52:05Z" level=debug msg="nodeID \"contour\" requested type.googleapis.com/envoy.config.route.v3.RouteConfiguration[https-443/*.wildcardhost.gateway.projectcontour.io] and known map[https-443/*.wildcardhost.gateway.projectcontour.io:{}]. Diff []" context=defaultCache

which would mean the failing test runs after this one:

Hostnames: []gatewayapi_v1.Hostname{"*.wildcardhost.gateway.projectcontour.io"},

curiously that test passes making HTTPS requests as expected, but I wonder if the failures in testRequestHeaderModifierBackendRef with plain HTTP request pollution point to an issue with the wildcard route

this is very hard to repro though locally since it would rely on the previous test configuration still existing in envoy while a new configuration is being added and our logic on wildcard hosts somehow being wrong, which I don't think is the case...

@sunjayBhatia
Copy link
Member

we could also maybe outlaw using echo as a backend name and always use unique names to fish this one out too

@sunjayBhatia
Copy link
Member

eh also the *.wildcardhost... test being the culprit also doesn't really make sense bc it doesn't set up any HTTP Listener at all, Gateways in all our tests only allow routes from the same namespace, etc.

the only other test that could be a culprit would be testTCPRoute which sets up a TCPRoute and Gateway with a Listener on port 80 and ofc doesn't have any hostname involvement

@sunjayBhatia sunjayBhatia merged commit 31ad9ba into projectcontour:main Mar 7, 2024
30 checks passed
@skriss skriss deleted the pr-e2e-fix branch March 7, 2024 15:35
lubronzhan pushed a commit to lubronzhan/contour that referenced this pull request Mar 13, 2024
…contour#6251)

For the RequestHeaderModifierBackendRef test, check
the service reached by the request as part of the
eventual consistency condition to avoid issues with
test pollution.

Signed-off-by: Steve Kriss <stephen.kriss@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/none-required Marks a PR as not requiring a release note. Should only be used for very small changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants