From e8182ce32931560406fee1c30745e56a2ee9a6b3 Mon Sep 17 00:00:00 2001 From: Anthony Ter-Saakov Date: Thu, 12 Jan 2023 07:03:04 -0800 Subject: [PATCH] have 'bazel test' non-test targets depend on --remote_download_output This fixes https://github.com/bazelbuild/bazel/issues/17190 Closes #17195. PiperOrigin-RevId: 501555041 Change-Id: Ie52f72fb82912dde135eaa56c02d9756eb31365b --- .../build/lib/remote/ToplevelArtifactsDownloader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/remote/ToplevelArtifactsDownloader.java b/src/main/java/com/google/devtools/build/lib/remote/ToplevelArtifactsDownloader.java index b4fd000090286b..b8b11d02822174 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/ToplevelArtifactsDownloader.java +++ b/src/main/java/com/google/devtools/build/lib/remote/ToplevelArtifactsDownloader.java @@ -184,9 +184,9 @@ private boolean shouldDownloadToplevelOutputs(ConfiguredTargetKey configuredTarg if (configuredTarget instanceof RuleConfiguredTarget) { var ruleConfiguredTarget = (RuleConfiguredTarget) configuredTarget; var isTestRule = isTestRuleName(ruleConfiguredTarget.getRuleClassString()); - return !isTestRule; + return !isTestRule && downloadToplevel; } - return true; + return downloadToplevel; } catch (InterruptedException ignored) { Thread.currentThread().interrupt(); return false;