-
Notifications
You must be signed in to change notification settings - Fork 271
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: Cleanup outbound_balancer_waits_for_ready_endpoint #2529
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The outbound_balancer_waits_for_ready_endpoint test doesn't reliably demonstrate the behavior it is trying to test: we setup two identical endpoints, so our tests can't be sure that the response is coming from the correct endpoint. This change updates this test to provide backends that return varied responses so we can ensure the desired behavior. This change also improves the test's logging. The discovery test infrastructure is updated to allow overriding the logical service address. This aids disambiguating addresses in logs.
hawkw
approved these changes
Nov 20, 2023
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.
looks good to me! i had one tiny suggestion
Comment on lines
+484
to
+493
assert_eq!( | ||
String::from_utf8( | ||
hyper::body::to_bytes(res.into_body()) | ||
.await | ||
.unwrap() | ||
.to_vec(), | ||
) | ||
.unwrap(), | ||
"beta" | ||
); |
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.
tiny nit: there's a body_string
function in the test utils that we could just use here:
Suggested change
assert_eq!( | |
String::from_utf8( | |
hyper::body::to_bytes(res.into_body()) | |
.await | |
.unwrap() | |
.to_vec(), | |
) | |
.unwrap(), | |
"beta" | |
); | |
assert_eq!(http_util::body_string(res.into_body()).await, "beta"); |
olix0r
added a commit
to linkerd/linkerd2
that referenced
this pull request
Nov 30, 2023
* Add a .codecov.yml (linkerd/linkerd2-proxy#2527) * stack: Add BoxCloneSyncService (linkerd/linkerd2-proxy#2523) * ci: Compute coverage over all tests (linkerd/linkerd2-proxy#2528) * stack-metrics: Implement Clone for TrackService (linkerd/linkerd2-proxy#2524) * ci: Fetch tarpaulin binary instead of compiling (linkerd/linkerd2-proxy#2532) * ci: Enable coverage on main and all PRs (linkerd/linkerd2-proxy#2533) * test: Cleanup consecutive_failures_accrue (linkerd/linkerd2-proxy#2531) * test: Improve error reporting in gauges_endpoints (linkerd/linkerd2-proxy#2530) * test: Cleanup outbound_balancer_waits_for_ready_endpoint (linkerd/linkerd2-proxy#2529) * meshtls: Consolidate TLS ID verification (linkerd/linkerd2-proxy#2534) * build(deps): bump DavidAnson/markdownlint-cli2-action (linkerd/linkerd2-proxy#2537) * build(deps): bump tj-actions/changed-files from 40.1.1 to 40.2.0 (linkerd/linkerd2-proxy#2536) Signed-off-by: Oliver Gould <[email protected]>
olix0r
added a commit
to linkerd/linkerd2
that referenced
this pull request
Nov 30, 2023
* Add a .codecov.yml (linkerd/linkerd2-proxy#2527) * stack: Add BoxCloneSyncService (linkerd/linkerd2-proxy#2523) * ci: Compute coverage over all tests (linkerd/linkerd2-proxy#2528) * stack-metrics: Implement Clone for TrackService (linkerd/linkerd2-proxy#2524) * ci: Fetch tarpaulin binary instead of compiling (linkerd/linkerd2-proxy#2532) * ci: Enable coverage on main and all PRs (linkerd/linkerd2-proxy#2533) * test: Cleanup consecutive_failures_accrue (linkerd/linkerd2-proxy#2531) * test: Improve error reporting in gauges_endpoints (linkerd/linkerd2-proxy#2530) * test: Cleanup outbound_balancer_waits_for_ready_endpoint (linkerd/linkerd2-proxy#2529) * meshtls: Consolidate TLS ID verification (linkerd/linkerd2-proxy#2534) * build(deps): bump DavidAnson/markdownlint-cli2-action (linkerd/linkerd2-proxy#2537) * build(deps): bump tj-actions/changed-files from 40.1.1 to 40.2.0 (linkerd/linkerd2-proxy#2536) Signed-off-by: Oliver Gould <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The outbound_balancer_waits_for_ready_endpoint test doesn't reliably demonstrate the behavior it is trying to test: we setup two identical endpoints, so our tests can't be sure that the response is coming from the correct endpoint.
This change updates this test to provide backends that return varied responses so we can ensure the desired behavior.
This change also improves the test's logging. The discovery test infrastructure is updated to allow overriding the logical service address. This aids disambiguating addresses in logs.