Repository navigation
testing: shared nested cache root (closes #14777) - #14799
Conversation
|
/evidence platforms=["macos_arm64","windows_x86_64"] task=test scope=//tools/testing/nested:dx_nested_test //tools/testing:nested_bazel_harness_test |
|
Evidence started on |
|
/evidence platforms=["macos_arm64","windows_x86_64"] task=test scope=//tools/testing/nested:dx_nested_test //tools/testing:nested_bazel_harness_test |
|
Evidence started on |
With DX_NESTED_SHARED set, every nested server shares the install base, the repository cache, the repo contents cache and a 4 GB disk cache under that root; output bases stay per test. setup-bazel points it at $RUNNER_TEMP/dx-nested. Cache-set entries land with one rename, so concurrent tests see no entry or a whole one. nested_bazel_test(caches = "private") and record mode stay off the root; cold_start_test opts out. Unset, nothing changes. Part of #14776 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus
… caches with a set Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus
A starting test takes the root's exclusive lock when no other test holds it and evicts the least recently used install bases, fetched repositories and downloads until the root fits; running tests hold a shared lock. The disk cache GC limit drops to 2 GB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus
d90f401 to
b4df89c
Compare
|
/evidence platforms=["macos_arm64","windows_x86_64"] task=test scope=//tools/testing/nested:dx_nested_test //tools/testing:nested_bazel_harness_test |
|
Evidence started on |
|
Review: changes requested (head b4df89c) 1. 2. 3. 4. 5. Checked and fine: concurrent first extraction of a shared install base (Bazel 9 extracts into a CI (run 45331102118): no failure is caused by this PR. The gate excludes
🤖 Generated with Claude Code |
…ed root Eviction renames an entry into `<root>/_trash` and deletes it after the root lock is released, so a stopped delete never leaves a half-deleted repository next to its `.recorded_inputs`; the next lease empties the trash. Each test registers a lease naming its install base, repository cache and repo contents cache; a starting test evicts only entries no running lease holds, so it trims the root without waiting. Install bases age by their own directory mtime, which the Bazel client stamps per start. setup-bazel exports DX_NESTED_SHARED through GITHUB_ENV and only nested_bazel_test inherits it, so other test actions keep their keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus
|
/evidence platforms=["linux_x86_64","windows_x86_64","macos_arm64"] task=test scope=//tools/testing/nested/... //tools/testing:nested_bazel_harness_test //tools/testing/consumer:go_prebuilt_guard_test //tools/testing/consumer:java_prebuilt_guard_test |
|
Evidence started on |
… (follow-up to #14799) (#14812) * testing: age shared cache entries by their files, not their directory Counting an entry directory's own mtime made a freshly created directory with old files look recently used, so the over-limit harness case evicted the install base instead of the stale repository. Only install bases age by their directory, which the Bazel client stamps per start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus * testing: close test files before evicting on Windows A directory holding an open file cannot be renamed on Windows, so the install base test kept its entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Part of #14776
DX_NESTED_SHARED(exported by setup-bazel through$GITHUB_ENVas$RUNNER_TEMP/dx-nested, with--sandbox_writable_path, and inherited only bynested_bazel_test) gives every nested server one shared--install_base(keyed by the Bazel binary) and a--disk_cachewith a 2 GB GC limit. The repository cache and--repo_contents_cacheare shared per cache set, so an offline test never finds a download its own set lacks. Output bases stay per test.DX_NESTED_SHARED_LIMIToverrides); Bazel has no size GC for the repository or repo contents cache. Each test registers a lease (a locked file under<root>/leases) naming its install base, repository cache and repo contents cache. Under a short exclusive lock on the root, a starting test moves the least recently used entries no running lease holds into<root>/_trash, then deletes them outside the lock; a stopped delete leaves only trash, which the next lease empties. A running lease holds its install base, its whole repository cache and the repo contents entries used since it started. Install bases age by their directory mtime, which the Bazel client stamps per start. Harness cases: an over-limit root evicts the stale entry first; trash left by a stopped delete is emptied and the repositories are still reused.nested_bazel_test(caches = "private")opts out;cold_start_testuses it. Record mode is always private. Unset, nothing changes.Timing, Linux x86_64 on a loaded, CPU-capped local machine (seconds, unset → warm shared root): go_prebuilt_guard 249 → 87, java_prebuilt_guard 181 → 89.
nested_smoke.txtlines scaled by that ratio: 44 → 16, 32 → 16. The other lines are not measurable here: the harness, adopt-polyglot and release consumers fail on the stale consumer locks of #13353; apple is macOS only; cpp_rust and cold_start do not use the shared root.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus