aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/remote
diff options
context:
space:
mode:
authorGravatar buchgr <buchgr@google.com>2017-07-14 12:58:50 +0200
committerGravatar László Csomor <laszlocsomor@google.com>2017-07-14 16:34:27 +0200
commit9f7edd7a7d66c34b937cbda01119dcb2dec6fdf5 (patch)
tree28c87302396c99af2f4c2bdd04da8a1d2be0c5cc /src/main/java/com/google/devtools/build/lib/remote
parent57ff834702f75760e2d611590e44c13f7b3c580d (diff)
remote: Don't cache test if marked "external". Fixes #3362
RELNOTES: None. PiperOrigin-RevId: 161937673
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/remote')
-rw-r--r--src/main/java/com/google/devtools/build/lib/remote/GrpcRemoteExecutor.java2
-rw-r--r--src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/remote/GrpcRemoteExecutor.java b/src/main/java/com/google/devtools/build/lib/remote/GrpcRemoteExecutor.java
index 68046fe2ca..06aabda492 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/GrpcRemoteExecutor.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/GrpcRemoteExecutor.java
@@ -40,7 +40,7 @@ import javax.annotation.Nullable;
/** A remote work executor that uses gRPC for communicating the work, inputs and outputs. */
@ThreadSafe
-final class GrpcRemoteExecutor {
+class GrpcRemoteExecutor {
private final Channel channel;
private final CallCredentials callCredentials;
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java
index 7a50e1cd3f..58c6c668a6 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java
@@ -96,7 +96,7 @@ final class RemoteSpawnRunner implements SpawnRunner {
// Look up action cache, and reuse the action output if it is found.
ActionKey actionKey = Digests.computeActionKey(action);
try {
- boolean acceptCachedResult = options.remoteAcceptCached;
+ boolean acceptCachedResult = options.remoteAcceptCached && Spawns.mayBeCached(spawn);
ActionResult result =
acceptCachedResult
? remoteCache.getCachedActionResult(actionKey)
@@ -198,7 +198,8 @@ final class RemoteSpawnRunner implements SpawnRunner {
ActionKey actionKey)
throws ExecException, IOException, InterruptedException {
SpawnResult result = fallbackRunner.exec(spawn, policy);
- if (options.remoteUploadLocalResults && remoteCache != null && actionKey != null) {
+ if (options.remoteUploadLocalResults && Spawns.mayBeCached(spawn) && remoteCache != null
+ && actionKey != null) {
ArrayList<Path> outputFiles = new ArrayList<>();
for (ActionInput output : spawn.getOutputFiles()) {
Path outputFile = execRoot.getRelative(output.getExecPathString());