Skip to content

Remove --local_test_jobs from bazelci.py - #2867

Open
meteorcloudy wants to merge 1 commit into
bazelbuild:masterfrom
meteorcloudy:remove-local-test-jobs
Open

meteorcloudy wants to merge 1 commit into
bazelbuild:masterfrom
meteorcloudy:remove-local-test-jobs

Conversation

@meteorcloudy

@meteorcloudy meteorcloudy commented Sep 17, 2026

Copy link
Copy Markdown
Member

Remove --local_test_jobs and concurrent_test_jobs() from execute_bazel_test and execute_bazel_coverage in bazelci.py.

Why

  1. Disables Bazel's CPU/RAM resource scheduler for tests: When --local_test_jobs is set to a non-zero value, Bazel's TestTargetProperties.getLocalResourceUsage() assigns cpu=0 and memory=0 to all test actions (unless explicitly tagged with cpu:N or resources:...), ignoring test size memory estimates (small/medium/large/enormous) and allowing build + test actions to oversubscribe host CPUs during mixed compilation/test phases.
  2. Warnings on ARM64 Linux (c4a-standard-8): concurrent_jobs sets --jobs=8 (cpu_count()), while concurrent_test_jobs hardcoded --local_test_jobs=12, causing Bazel to emit a warning on every test/coverage run (WARNING: High value for --local_test_jobs: 12. This exceeds the value for --jobs: 8.).
  3. Underutilization on 30-core Linux/Windows VMs (c2-standard-30): Hardcoding --local_test_jobs to 12 on Linux and 8 on Windows left 60%–73% of CPU cores idle during pure test execution phases.
  4. Projects that need specific concurrency limits (like Bazel's own CI on macOS) already configure --local_test_jobs in their .bazelci/presubmit.yml.

Let Bazel use its default --local_test_jobs=auto (0) so that local test concurrency is managed by ResourceManager based on HOST_CPUS, HOST_RAM, test sizes, and cpu/resources tags instead of bypassing CPU/RAM accounting.
@meteorcloudy

Copy link
Copy Markdown
Member Author

Also tested on Bazel via bazelbuild/bazel#31171

@meteorcloudy

Copy link
Copy Markdown
Member Author

Looks like this actually causing tests to be flaky on windows, I need to investigate more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants