Skip to content
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

[7.1.0] Fix a flaky test by avoiding leaking the eager capability RPC thread. #21550

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ private static ReferenceCountedChannel createChannel(
requirement),
maxConnections);
// Eagerly start creating the channel and verifying the capabilities in the background.
// TODO(tjgq): Make sure this task doesn't linger beyond afterCommand().
var unused =
executorService.submit(
() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,12 @@ public void testVerifyCapabilities_none() throws Exception {
// Remote downloader uses Remote Asset API, and Bazel doesn't have any capability requirement
// on the endpoint. Expecting the request count is 0.
assertThat(cacheCapabilitiesImpl.getRequestCount()).isEqualTo(0);

// Retrieve the execution capabilities so that the asynchronous task that eagerly requests
// them doesn't leak and accidentally interfere with other test cases.
assertThat(remoteModule.getActionContextProvider().getRemoteCache().getCacheCapabilities())
.isEqualTo(EXEC_AND_CACHE_CAPS.getCacheCapabilities());

assertCircuitBreakerInstance();
} finally {
executionServer.shutdownNow();
Expand Down
Loading