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

tests: fix flaky HTTPRoute creation #44

Merged
merged 1 commit into from
Mar 20, 2024
Merged

Conversation

pmalek
Copy link
Member

@pmalek pmalek commented Mar 20, 2024

Previous attempt in #13 failed to account for the fact that if first call to Create() fails like so:

    test_httproute.go:164: failed to deploy httproute: admission webhook "httproutes.validation.ingress-controller.konghq.com" denied the request: Unable to validate HTTPRoute schema: making HTTP request: Post "https://10-244-227-242.dataplane-admin-9900d552-f1b5-41f1-bf65-ac46c3b727f9-9hlfz6624j.2e004961-3189-40ae-b0c4-d9c476a6fe9c.svc:8444/schemas/routes/validate": dial tcp 10.244.227.242:8444: connect: connection refused

then the variable set as result will be overwritten with an empty value and all the subsequent invocations will also fail with the following message:

    test_httproute.go:164: failed to deploy httproute: HTTPRoute.gateway.networking.k8s.io "" is invalid: [metadata.name: Required value: name or generateName is required, <nil>: Invalid value: "null": some validation rules were not checked because the object was invalid; correct the existing errors to complete validation]

This PR should fix that issue by not reusing the same variable as an argument and return value.

@pmalek pmalek self-assigned this Mar 20, 2024
@pmalek pmalek marked this pull request as ready for review March 20, 2024 15:57
@pmalek pmalek requested a review from a team as a code owner March 20, 2024 15:57
@pmalek pmalek enabled auto-merge (squash) March 20, 2024 15:57
@pmalek pmalek merged commit 31114aa into main Mar 20, 2024
13 checks passed
@pmalek pmalek deleted the fix-flaky-httproute-creation branch March 20, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants