Skip to content

tests: Properly simulate destination errors#332

Merged
olix0r merged 2 commits intomasterfrom
ver/test-discover-errors
Sep 3, 2019
Merged

tests: Properly simulate destination errors#332
olix0r merged 2 commits intomasterfrom
ver/test-discover-errors

Conversation

@olix0r
Copy link
Member

@olix0r olix0r commented Sep 2, 2019

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, 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.

Furthermore the tests:

  • outbound_destinations_reset_on_reconnect_followed_by_add_none
  • outbound_destinations_reset_on_reconnect_followed_by_remove_none

have been changed to exercise the empty/DNE cases. There is no
realistic scenario where the destination service would return an empty
add or remove.

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
@olix0r olix0r self-assigned this Sep 2, 2019
@olix0r olix0r merged commit 5c23190 into master Sep 3, 2019
@olix0r olix0r deleted the ver/test-discover-errors branch September 3, 2019 20:52
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants