diff --git a/src/main/java/com/google/devtools/build/lib/remote/options/RemoteOptions.java b/src/main/java/com/google/devtools/build/lib/remote/options/RemoteOptions.java index 37fec405aa2f5a..aec53d0a4b8003 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/options/RemoteOptions.java +++ b/src/main/java/com/google/devtools/build/lib/remote/options/RemoteOptions.java @@ -280,7 +280,7 @@ public String getTypeDescription() { @Option( name = "incompatible_remote_results_ignore_disk", - defaultValue = "false", + defaultValue = "true", category = "remote", documentationCategory = OptionDocumentationCategory.REMOTE, effectTags = {OptionEffectTag.UNKNOWN}, diff --git a/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnCacheTest.java b/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnCacheTest.java index 603de7c5ef864a..fbeb680df9d9e7 100644 --- a/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnCacheTest.java +++ b/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnCacheTest.java @@ -422,19 +422,15 @@ public void noRemoteCacheSpawns_remoteCache() throws Exception { public void noRemoteCacheSpawns_combinedCache() throws Exception { // Checks that spawns satisfying Spawns.mayBeCachedRemotely=false are not looked up in the // remote cache, and that the results/artifacts are not uploaded to the remote cache. - // For the purposes of execution requirements, a combined cache with a remote component - // is considered a remote cache + // The disk cache part of a combined cache is considered as a local cache hence spawns tagged + // with NO_REMOTE can sill hit it. RemoteOptions combinedCacheOptions = Options.getDefaults(RemoteOptions.class); combinedCacheOptions.remoteCache = "https://somecache.com"; combinedCacheOptions.diskCache = PathFragment.create("/etc/something/cache/here"); RemoteSpawnCache remoteSpawnCache = remoteSpawnCacheWithOptions(combinedCacheOptions); for (String requirement : - ImmutableList.of( - ExecutionRequirements.NO_CACHE, - ExecutionRequirements.LOCAL, - ExecutionRequirements.NO_REMOTE_CACHE, - ExecutionRequirements.NO_REMOTE)) { + ImmutableList.of(ExecutionRequirements.NO_CACHE, ExecutionRequirements.LOCAL)) { SimpleSpawn uncacheableSpawn = simpleSpawnWithExecutionInfo(ImmutableMap.of(requirement, "")); CacheHandle entry = remoteSpawnCache.lookup(uncacheableSpawn, simplePolicy); verify(remoteCache, never()) diff --git a/src/test/shell/bazel/remote/remote_execution_test.sh b/src/test/shell/bazel/remote/remote_execution_test.sh index 32c92a577d86e7..5bdd0d077d5048 100755 --- a/src/test/shell/bazel/remote/remote_execution_test.sh +++ b/src/test/shell/bazel/remote/remote_execution_test.sh @@ -1441,11 +1441,7 @@ EOF bazel clean bazel build $spawn_flags $testcase_flags $remote_exec_flags $grpc_flags $disk_flags //a:test &> $TEST_log \ || fail "CASE 3 failed to build" - if [[ "$testcase_flags" == --noremote_accept_cached ]]; then - expect_log "2 processes: 1 internal, 1 remote." "CASE 3: unexpected action line [[$(grep processes $TEST_log)]]" - else - expect_log "2 processes: 1 disk cache hit, 1 internal." "CASE 3: unexpected action line [[$(grep processes $TEST_log)]]" - fi + expect_log "2 processes: 1 disk cache hit, 1 internal." "CASE 3: unexpected action line [[$(grep processes $TEST_log)]]" # Case 4) # disk_cache, remote_cache: remote_exec, disk_cache, remote_cache @@ -1455,11 +1451,7 @@ EOF bazel clean bazel build $spawn_flags $testcase_flags $remote_exec_flags $grpc_flags $disk_flags //a:test &> $TEST_log \ || fail "CASE 4 failed to build" - if [[ "$testcase_flags" == --noremote_accept_cached ]]; then - expect_log "2 processes: 1 internal, 1 remote." "CASE 4: unexpected action line [[$(grep processes $TEST_log)]]" - else - expect_log "2 processes: 1 disk cache hit, 1 internal." "CASE 4: unexpected action line [[$(grep processes $TEST_log)]]" - fi + expect_log "2 processes: 1 disk cache hit, 1 internal." "CASE 4: unexpected action line [[$(grep processes $TEST_log)]]" # One last slightly more complicated case. # Build a target that depended on the last target but we clean and clear the remote cache. @@ -1474,11 +1466,7 @@ EOF bazel clean bazel build $spawn_flags $testcase_flags --genrule_strategy=remote $remote_exec_flags $grpc_flags $disk_flags //a:test2 &> $TEST_log \ || fail "CASE 5 failed to build //a:test2" - if [[ "$testcase_flags" == --noremote_accept_cached ]]; then - expect_log "3 processes: 1 internal, 2 remote." "CASE 5: unexpected action line [[$(grep processes $TEST_log)]]" - else - expect_log "3 processes: 1 disk cache hit, 1 internal, 1 remote." "CASE 5: unexpected action line [[$(grep processes $TEST_log)]]" - fi + expect_log "3 processes: 1 disk cache hit, 1 internal, 1 remote." "CASE 5: unexpected action line [[$(grep processes $TEST_log)]]" } function test_combined_disk_remote_exec_nocache_tag() {