Skip to content

Commit

Permalink
Tune integration tests for build rewinding.
Browse files Browse the repository at this point in the history
5 was picked randomly for --experimental_remote_cache_eviction_retries in the integration test. While it is working perfectly to test the rewinding, it cannot reports transient errors (e.g. #18696) because a next retry will probably fix that. This CL changes it to 1.

Also add a assert to check invocation ids from second attempt is different to catch #18694.

PiperOrigin-RevId: 541855893
Change-Id: I5f07cc1ed91a328454ed4949a04ff1acf6fa98b7
  • Loading branch information
coeuvre authored and copybara-github committed Jun 20, 2023
1 parent 8b762e5 commit 70aae47
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/test/shell/bazel/remote/build_without_the_bytes_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1782,11 +1782,18 @@ EOF
bazel build \
--remote_executor=grpc://localhost:${worker_port} \
--remote_download_minimal \
--experimental_remote_cache_eviction_retries=5 \
--experimental_remote_cache_eviction_retries=1 \
//a:bar >& $TEST_log || fail "Failed to build"

expect_log 'Failed to fetch blobs because they do not exist remotely.'
expect_log "Found remote cache eviction error, retrying the build..."

local invocation_ids=$(grep "Invocation ID:" $TEST_log)
local first_id=$(echo "$invocation_ids" | head -n 1)
local second_id=$(echo "$invocation_ids" | tail -n 1)
if [ "$first_id" == "$second_id" ]; then
fail "Invocation IDs are the same"
fi
}

function test_remote_cache_eviction_retries_with_fixed_invocation_id() {
Expand Down Expand Up @@ -1842,7 +1849,7 @@ EOF
--invocation_id=91648f28-6081-4af7-9374-cdfd3cd36ef2 \
--remote_executor=grpc://localhost:${worker_port} \
--remote_download_minimal \
--experimental_remote_cache_eviction_retries=5 \
--experimental_remote_cache_eviction_retries=1 \
//a:bar >& $TEST_log && fail "Expected build to fail"

expect_log 'Failed to fetch blobs because they do not exist remotely.'
Expand Down

0 comments on commit 70aae47

Please sign in to comment.