-
Notifications
You must be signed in to change notification settings - Fork 548
Improve distribution tests in conformance for MeshHTTPRouteWeight #3855
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
base: main
Are you sure you want to change the base?
Improve distribution tests in conformance for MeshHTTPRouteWeight #3855
Conversation
Signed-off-by: carsontham <carsontham@outlook.com>
@carsontham: The label(s) In 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 kubernetes-sigs/prow repository. |
Welcome @carsontham! |
Hi @carsontham. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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 kubernetes-sigs/prow repository. |
/area conformance-test |
Nice, thanks for helping out with this! /ok-to-test |
Thanks @carsontham ! did you try to run conformance and see that it works? |
Hey @LiorLieberman ! I tried running the conformance test by doing something like this:
and the results are like:
I also tried running the MeshHTTPRouteWeight test before making this PR, and observed similar results. I'm not too sure if it is because I am running the tests wrongly, or if the implementations does not conform to the weighted backend yet. Could you point me in the correct direction so that I can run the test properly? thanks! |
Does #3826 (comment) help? Install istio and follow the command I listed here. |
hi @LiorLieberman ! I managed to get the test running using the command as advised. Thanks!
|
Thanks! did you run with. |
I've ran the command here:
attaching the test logs as file as there is character limits for comments on Github. Thanks ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @carsontham! this looks good to me with one comment.
Do you also want to add it to conformance/tests/httproute-weight.go
and perhaps make the function in a shared package somewhere so you dont need to duplicate the code between the files?
/approve
/cc @guicassolato for addtl review
// addEntropy adds jitter to the request by adding either a delay up to 1 second, or a random header value, or both. | ||
func addEntropy(exp *http.ExpectedResponse) { | ||
delay := func() { time.Sleep(time.Duration(rand.Intn(1000)) * time.Millisecond) } //nolint:gosec // This is test code to get random value. | ||
randomHeader := func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this no lint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe using crypto.rand would make it happy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed! slightly lengthier due to error handling 😃
also re-ran the tests after using crypto.rand, attaching the new output test logs here:
MeshHTTPRouteWeight_updated.log
@LiorLieberman: GitHub didn't allow me to request PR reviews from the following users: for, review. Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs. In 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 kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: carsontham, LiorLieberman The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hey @LiorLieberman! sure thing, but taking a quick look, not too sure where i could put this shared function, perhaps somewhere like also do you prefer it to be in the same current PR? or should I create another PR after this gets approved? |
I was thinking somewhere here maybe? https://github.com/kubernetes-sigs/gateway-api/tree/main/conformance/utils. You could do another PR yeah, and tag me there so its easier review. once we finish the small comment thread we have I can lgtm this |
sure! i will follow up with a continuation PR after this PR is done. thanks alot @LiorLieberman! |
Sweet, thanks @carsontham! /lgtm |
What type of PR is this?
/area conformance-test
What this PR does / why we need it:
Adding entropy to distribution tests as per comment #3827 (comment)
This is done by introducing random jitter by adding either a short delay, or adding random header values, or both.
Which issue(s) this PR fixes:
Fixes #3832
Does this PR introduce a user-facing change?: