From 70aae4780e596c30e8417742aff70e7a8002735e Mon Sep 17 00:00:00 2001 From: Googler Date: Tue, 20 Jun 2023 03:21:27 -0700 Subject: [PATCH] Tune integration tests for build rewinding. 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 --- .../bazel/remote/build_without_the_bytes_test.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/test/shell/bazel/remote/build_without_the_bytes_test.sh b/src/test/shell/bazel/remote/build_without_the_bytes_test.sh index ab186eca0707c9..1904a68c503b3a 100755 --- a/src/test/shell/bazel/remote/build_without_the_bytes_test.sh +++ b/src/test/shell/bazel/remote/build_without_the_bytes_test.sh @@ -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() { @@ -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.'