Skip to content

Commit

Permalink
Flip --incompatible_remote_results_ignore_disk
Browse files Browse the repository at this point in the history
Fixes #15148.

Closes #16282.

PiperOrigin-RevId: 476308483
Change-Id: I834a2a278a6d3b5262e5199dd3c86ef54fa56c9d
  • Loading branch information
coeuvre authored and copybara-github committed Sep 23, 2022
1 parent 4c84ce1 commit 4c56431
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
18 changes: 3 additions & 15 deletions src/test/shell/bazel/remote/remote_execution_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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() {
Expand Down

0 comments on commit 4c56431

Please sign in to comment.