tests: Properly simulate destination errors#332
Merged
Conversation
The `discovery` tests attempt to simulate the scenario where the destination service responds with an `InvalidArgument` gRPC status so the proxy knows to skip balancing. The tests don't accurately simulate this behavior, however. The destination controller eagerly fails such requests [1], rather than successfully returning a stream that fails immediately. At the protocol level, this causes the `grpc-status` to be encoded in the firt and only HTTP response header frame, rather than in a trailer (i.e after the initial `END_HEADERS` frame was sent indicating the begining of the respnose steram); and in tower, this causes the initial response future to fail. This change modifies the mock controller and discovery tests so that tests can fail the response eagerly without initiating the response stream. [1]: https://github.com/linkerd/linkerd2/blob/e281fb3410138a8a9505220ecddea627dd9fdc2d/controller/api/destination/server.go#L96-L112
hawkw
approved these changes
Sep 3, 2019
olix0r
added a commit
to linkerd/linkerd2
that referenced
this pull request
Sep 5, 2019
* Stop using a Builder in the profile router (linkerd/linkerd2-proxy#330) * Update and rename .github/workflows/rust.yml to rust.yml * Fix compile error on windows (linkerd/linkerd2-proxy#335) * Revert "Update and rename .github/workflows/rust.yml to rust.yml" * travis: Allow 60 minutes for integration tests (linkerd/linkerd2-proxy#336) * tests: Properly simulate destination errors (linkerd/linkerd2-proxy#332) * Improve stack-related compiler error messages (linkerd/linkerd2-proxy#337) * update hyper to v0.12.34
olix0r
added a commit
to linkerd/linkerd2
that referenced
this pull request
Sep 5, 2019
* Stop using a Builder in the profile router (linkerd/linkerd2-proxy#330) * Update and rename .github/workflows/rust.yml to rust.yml * Fix compile error on windows (linkerd/linkerd2-proxy#335) * Revert "Update and rename .github/workflows/rust.yml to rust.yml" * travis: Allow 60 minutes for integration tests (linkerd/linkerd2-proxy#336) * tests: Properly simulate destination errors (linkerd/linkerd2-proxy#332) * Improve stack-related compiler error messages (linkerd/linkerd2-proxy#337) * update hyper to v0.12.34
This file contains hidden or 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
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
discoverytests attempt to simulate the scenario where the destinationservice responds with an
InvalidArgumentgRPC status so the proxyknows to skip balancing. The tests don't accurately simulate this
behavior, however.
The destination controller eagerly fails such requests, rather than
successfully returning a stream that fails immediately. At the protocol
level, this causes the
grpc-statusto be encoded in the firt and onlyHTTP response header frame, rather than in a trailer (i.e after the
initial
END_HEADERSframe was sent indicating the begining of therespnose steram); and in tower, this causes the initial response future
to fail.
This change modifies the mock controller and discovery tests so that
tests can fail the response eagerly without initiating the response
stream.
Furthermore the tests:
outbound_destinations_reset_on_reconnect_followed_by_add_noneoutbound_destinations_reset_on_reconnect_followed_by_remove_nonehave been changed to exercise the empty/DNE cases. There is no
realistic scenario where the destination service would return an empty
add or remove.