Skip to content

[9.3.0] Keep an unrelated fetch from using up the memory pressure drop budget in a test (https://github.com/bazelbuild/bazel/pull/30757) - #30917

Merged
meteorcloudy merged 1 commit into
bazelbuild:release-9.3.0from
bazel-io:cp30757-9.3.0-190405
Sep 2, 2026
Merged

Conversation

@bazel-io

Copy link
Copy Markdown
Member

Description

testMemoryPressureRestartDuringCachedFetch relies on a compute state drop landing while the cached fetch of my_repo is in flight, but the budget of --skyframe_high_water_mark_minor_gc_drops_per_invocation is shared by every fetch in the invocation. On Windows, test_base registers a Python toolchain from rules_python, so every attempt starts by fetching that repo, whose contents are large enough to use up all 8 drops within the first few seconds. No full GC happens afterwards, so the fetch under test is never interrupted.

rules_python is now fetched before the poison build, without a remote cache so that it ends up on disk rather than being injected into the memory of the server that runs the fetch: the poison build uses a different server (it sets --host_jvm_args=-Xmx512m) and would otherwise have to inject it again.

Motivation

The test is flaky on Windows:

AssertionError: the cached fetch of my_repo was never both interrupted by a memory-pressure compute state drop and served from the cache

I instrumented it on Windows CI to log every state drop and every fetch restart to the server log. In a run of 30 attempts, only 2 saw a restart of my_repo; every drop in the other 28 was spent on a restart of @@rules_python+, all 8 of them within the first ~5 seconds of the build. With this change, all 25 attempts of a run of the same shape were interrupted while still being served from the cache.

The same runs also uncovered a crash that this test can hit on any platform, fixed in #30756.

Build API Changes

No

Checklist

  • I have added tests for the new use cases (if any).
  • I have updated the documentation (if applicable).

Release Notes

RELNOTES: None

Closes #30757.

PiperOrigin-RevId: 966480487
Change-Id: I57dd23bb2e2dd4e73b352deaf476214cff4f66a7

Commit d59116e

… in a test (bazelbuild#30757)

### Description

`testMemoryPressureRestartDuringCachedFetch` relies on a compute state drop landing while the cached fetch of `my_repo` is in flight, but the budget of `--skyframe_high_water_mark_minor_gc_drops_per_invocation` is shared by every fetch in the invocation. On Windows, `test_base` registers a Python toolchain from rules_python, so every attempt starts by fetching that repo, whose contents are large enough to use up all 8 drops within the first few seconds. No full GC happens afterwards, so the fetch under test is never interrupted.

rules_python is now fetched before the poison build, without a remote cache so that it ends up on disk rather than being injected into the memory of the server that runs the fetch: the poison build uses a different server (it sets `--host_jvm_args=-Xmx512m`) and would otherwise have to inject it again.

### Motivation

The test is flaky on Windows:

```
AssertionError: the cached fetch of my_repo was never both interrupted by a memory-pressure compute state drop and served from the cache
```

I instrumented it on Windows CI to log every state drop and every fetch restart to the server log. In a run of 30 attempts, only 2 saw a restart of `my_repo`; every drop in the other 28 was spent on a restart of `@@rules_python+`, all 8 of them within the first ~5 seconds of the build. With this change, all 25 attempts of a run of the same shape were interrupted while still being served from the cache.

The same runs also uncovered a crash that this test can hit on any platform, fixed in bazelbuild#30756.

### Build API Changes

No

### Checklist

- [x] I have added tests for the new use cases (if any).
- [ ] I have updated the documentation (if applicable).

### Release Notes

RELNOTES: None

Closes bazelbuild#30757.

PiperOrigin-RevId: 966480487
Change-Id: I57dd23bb2e2dd4e73b352deaf476214cff4f66a7
@bazel-io
bazel-io requested a review from a team as a code owner August 28, 2026 19:04
@bazel-io bazel-io added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Aug 28, 2026
@bazel-io
bazel-io requested a review from Wyverald August 28, 2026 19:04
@iancha1992
iancha1992 enabled auto-merge August 28, 2026 19:07
@meteorcloudy
meteorcloudy added this pull request to the merge queue Sep 2, 2026
Merged via the queue into bazelbuild:release-9.3.0 with commit 86c7366 Sep 2, 2026
42 checks passed
@github-actions github-actions Bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants