Skip to content

Make the archive in test_distdir_option_not_sticky unique - #31266

Closed
fmeum wants to merge 1 commit into
bazelbuild:masterfrom
fmeum:fix-distdir-flake
Closed

fmeum wants to merge 1 commit into
bazelbuild:masterfrom
fmeum:fix-distdir-flake

Conversation

@fmeum

@fmeum fmeum commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

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

Six other cases of external_integration_test create an archive with exactly the same contents. 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.

Add a file with the test's own temporary directory to the archive so that no other test or attempt can have cached it.
@fmeum
fmeum marked this pull request as ready for review September 22, 2026 18:23
@github-actions github-actions Bot added the awaiting-review PR is awaiting review from an assigned reviewer label Sep 22, 2026
@meteorcloudy meteorcloudy added the copybara:import Trigger copybara to import the PR label Sep 23, 2026
@github-actions github-actions Bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copybara:import Trigger copybara to import the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants