Conversation
fmeum
force-pushed
the
fix-reverse-dependency-test
branch
from
September 22, 2026 17:58
90239af to
43107eb
Compare
The repo contents cache defaults to a directory under the repository cache. The Python, shell and blackbox test harnesses point `--repository_cache` at `REPOSITORY_CACHE` on CI, which is shared between all tests and test attempts on a machine, so they unintentionally shared the repo contents cache as well. This made `bazel_module_test.testReverseDependencyDirection` fail on every retry of a Windows shard: the first attempt fetches its reproducible repos into the shared cache, the retry finds them there and never fetches, and the test then fails on the missing "JUST FETCHED" output. The harnesses now disable the repo contents cache, matching what several tests already did for themselves, and those opt-outs are removed. The tests that exercise the cache opt in explicitly: `repo_contents_cache_test` appends its cache to the harness bazelrc, which takes precedence over the workspace `.bazelrc` it used before, and `testForceFetchWithRepoCache` as well as `testReverseDependencyDirection` use a private cache outside of the workspace. Two cases of `external_integration_test` had come to depend on the cache without being about it. `test_cached_across_server_restart` printed the recorded inputs of the cache entry, which the repo contents cache commit had substituted for the repo's marker file; it prints the marker file again. `test_cache_hit_reported` asserted on `cache hit`, which also matches the "N action cache hit" build summary that only shows up without the repo contents cache, since the repo is then actually re-fetched and its actions re-checked; it now asserts on the wording of the report it is about.
fmeum
force-pushed
the
fix-reverse-dependency-test
branch
from
September 22, 2026 18:35
43107eb to
389c1b5
Compare
fmeum
marked this pull request as ready for review
September 22, 2026 19:50
meteorcloudy
approved these changes
Sep 23, 2026
copybara-service Bot
pushed a commit
that referenced
this pull request
Sep 23, 2026
### Description Six other cases of `external_integration_test` create an archive with exactly the same contents as `test_distdir_option_not_sticky`. Zip stores modification times with a granularity of two seconds, so when two of them run within the same second in different shards, the archives are byte-identical and thus have the same checksum. Every shard on a CI machine shares the same repository cache, so as soon as the other case has fetched its copy, the build without `--distdir` in this test finds the archive in the cache and succeeds although it is expected to fail. The test now adds a file with its own temporary directory to the archive so that no other test or attempt can have cached it. ### Motivation `test_distdir_option_not_sticky` failed on the first attempt of a Linux shard of #31263 and passed on the retry, and it fails the same way locally when all shards of the test start at the same time with a shared `REPOSITORY_CACHE`. The build that is expected to fail fetches the repo without any download, which is only possible with a repository cache hit. ### Build API Changes No ### Release Notes RELNOTES: None Closes #31266 COPYBARA_INTEGRATE_REVIEW=#31266 from fmeum:fix-distdir-flake 7ce06b0 PiperOrigin-RevId: 986957565 Change-Id: I9bf7ba48d7bcce3913731b43a5e8b1ed7f5b1961
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The repo contents cache defaults to a directory under the repository cache. The Python, shell and blackbox test harnesses point
--repository_cacheatREPOSITORY_CACHEon CI, which is shared between all tests and test attempts on a machine, so they unintentionally shared the repo contents cache as well.The harnesses now disable the repo contents cache globally, matching what several tests already did for themselves, and those opt-outs are removed. The tests that exercise it opt in explicitly:
repo_contents_cache_testappends its cache to the harness bazelrc, which takes precedence over the workspace.bazelrcit used before, andtestForceFetchWithRepoCacheas well astestReverseDependencyDirectionuse a private cache outside of the workspace.Two cases of
external_integration_testhad come to depend on the cache without being about it.test_cached_across_server_restartprinted the recorded inputs of the cache entry, which the repo contents cache commit had substituted for the repo's marker file; it prints the marker file again.test_cache_hit_reportedasserted oncache hit, which also matches the "N action cache hit" build summary that only shows up without the repo contents cache, since the repo is then actually re-fetched and its actions re-checked; it now asserts on the wording of the report it is about.Motivation
Discovered as
bazel_module_test.testReverseDependencyDirectionfailed on every retry: the first attempt passes this test and fails another one on a Windows-only install base issue, and the retries then find the test's reproducible repos in the shared cache and never fetch them, so the "JUST FETCHED" output the test asserts on is missing.Build API Changes
No
Release Notes
RELNOTES: None