From dbc367a28aaf54762e67904cea15720fd281a0a2 Mon Sep 17 00:00:00 2001 From: Googler Date: Fri, 19 Jan 2024 10:26:40 -0800 Subject: [PATCH] Fix flakiness in `//src/test/shell/bazel:starlark_repository_test` Make sure repository cache is not used by adding --repository_cache= to bazelrc https://buildkite.com/bazel/bazel-bazel/builds/26360#018d21bc-b66f-4f99-98af-de50fc10794f Fixes https://github.com/bazelbuild/bazel/issues/20790 PiperOrigin-RevId: 599872040 Change-Id: I8203d15a8826431f5eb4de9dc33894dc5be21936 --- src/test/shell/bazel/starlark_repository_test.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/shell/bazel/starlark_repository_test.sh b/src/test/shell/bazel/starlark_repository_test.sh index a6e348b76177eb..12170039ec80a1 100755 --- a/src/test/shell/bazel/starlark_repository_test.sh +++ b/src/test/shell/bazel/starlark_repository_test.sh @@ -70,6 +70,9 @@ source "$(rlocation "io_bazel/src/test/shell/bazel/remote_helpers.sh")" \ mock_rules_java_to_avoid_downloading +# Make sure no repository cache is used in this test +add_to_bazelrc "build --repository_cache=" + # Basic test. function test_macro_local_repository() { create_new_workspace @@ -2329,7 +2332,8 @@ genrule( ) EOF - bazel build --distdir="." --repository_disable_download //:it || fail "Failed to build" + # for some reason --repository_disable_download fails with bzlmod trying to download @platforms. + bazel build --distdir="." --repository_disable_download --noenable_bzlmod //:it || fail "Failed to build" } function test_disable_download_should_allow_local_repository() {