update test-support clients and servers to be natively async#580
Merged
update test-support clients and servers to be natively async#580
Conversation
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Because the test server is now running on the same runtime as everything else, any tasks it spawns are no longer cancelled when the server is dropped (which used to shut down the server's runtime). Moving it to the same runtime meant that if the server is shut down, the spawned task that owns the `TcpListener` is _not_ cancelled, and the connection from the proxy remains open. Some tests relied on servers closing their socket when dropped, and this behavior broke those tests. This commit reuses the existing graceful shutdown code to ensure the test server cancels all tasks it spawns when shutdown is triggered. Signed-off-by: <Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
it's more trustwrthy Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
42dc7f8 to
ad5e2f9
Compare
olix0r
pushed a commit
that referenced
this pull request
Jun 30, 2020
This branch updates the test support mock control plane components in `linkerd2-app-integration` to use `std::future`, Tonic, and Tokio 0.2. Rather than spawning a separate thread for each control plane componwnr as we did previously, they are now spawned as tasks on the main test thread's runtime. As discussed in #580, this _may_ make the tests slightly less flaky and/or slightly faster on CI. Closes linkerd/linkerd2#3963 Signed-off-by: Eliza Weisman <[email protected]>
olix0r
added a commit
to linkerd/linkerd2
that referenced
this pull request
Jul 2, 2020
This release increases the default buffer size to match the proxy's in-flight request limit. This reduces contention in overload--especially high-concurrency--situations, substantially reducing tail latency. --- * update test-support clients and servers to be natively async (linkerd/linkerd2-proxy#580) * Print build diagnostics in docker (linkerd/linkerd2-proxy#583) * update test controllers to std::future/Tonic; remove threads (linkerd/linkerd2-proxy#585) * buffer: Box the inner service's reponse future (linkerd/linkerd2-proxy#586) * Eliminate Bind & Listen traits (linkerd/linkerd2-proxy#584) * cache: replace Lock with Buffer (linkerd/linkerd2-proxy#587)
cpretzer
pushed a commit
to linkerd/linkerd2
that referenced
this pull request
Jul 2, 2020
This release increases the default buffer size to match the proxy's in-flight request limit. This reduces contention in overload--especially high-concurrency--situations, substantially reducing tail latency. --- * update test-support clients and servers to be natively async (linkerd/linkerd2-proxy#580) * Print build diagnostics in docker (linkerd/linkerd2-proxy#583) * update test controllers to std::future/Tonic; remove threads (linkerd/linkerd2-proxy#585) * buffer: Box the inner service's reponse future (linkerd/linkerd2-proxy#586) * Eliminate Bind & Listen traits (linkerd/linkerd2-proxy#584) * cache: replace Lock with Buffer (linkerd/linkerd2-proxy#587)
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.
Currently, the test clients and servers in
linkerd2-app-integrationeach run their own separate Tokio runtime on a background thread. This
was done in order to allow writing the test code in a synchronous
fashion, rather than using futures. Now, however, a majority of the
tests already use async-await syntax, so we can run all this stuff on
the same test runtime. This should reduce the number of threads in the
tests significantly, which may decrease flakiness and possibly improve
test performance a bit.
This branch updates the test support servers and clients to run as tasks
spawned on the main test runtime. It does not touch the test control
plane (Destination and Identity services) as they still need to be
updated to use Tonic and
std::future.This does introduce one potential footgun that is worth noting: if a
test server that makes assertions is spawned in the background, the
JoinHandlefor its task must be awaited. Otherwise, panics will not bepropagated to the main test task, and the test can spuriously pass if
the assertion fails.
Signed-off-by: Eliza Weisman [email protected]