From 812b7cc3b78afbcaa1fa9dfc13c708c78d4d1d85 Mon Sep 17 00:00:00 2001 From: Adam Perry Date: Sat, 6 Jun 2026 04:52:09 +0000 Subject: [PATCH] Limit local Bazel test concurrency --- .bazelrc | 6 ++++++ codex-rs/docs/bazel.md | 10 ++++++++++ justfile | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index fa93a15aa0..9d12cad3ca 100644 --- a/.bazelrc +++ b/.bazelrc @@ -77,6 +77,12 @@ common:buildbuddy-openai-rbe --remote_executor=grpcs://openai.buildbuddy.io # memory in exchange for higher download concurrency. common --jobs=30 +# Full local test runs include heavily sharded suites whose processes can +# contend for CPU and SQLite resources. Keep these limits opt-in so remote and +# CI configurations retain their existing concurrency. +test:local-test --jobs=8 +test:local-test --local_test_jobs=2 + # Shared remote execution policy. The endpoint-bearing `buildbuddy-*-rbe` # configurations include this group; CI configs override TestRunner below # when tests must remain local on their runner. diff --git a/codex-rs/docs/bazel.md b/codex-rs/docs/bazel.md index f12eeefd70..35f331fb57 100644 --- a/codex-rs/docs/bazel.md +++ b/codex-rs/docs/bazel.md @@ -29,6 +29,16 @@ just bazel-test just bazel-clippy ``` +`just bazel-test` selects the opt-in `local-test` Bazel configuration. It caps +local build actions at 8 and local test processes at 2 so the heavily sharded +app-server, core, and TUI suites do not overwhelm developer machines or +contend excessively for SQLite resources. The cap only controls scheduling: +all test targets and their configured shards still run. + +Direct `bazel test` commands do not select this configuration automatically. +Use `--config=local-test` for the same scheduling limits. CI uses its existing +CI-specific configurations and concurrency. + Ordinary local `bazel` and `just` invocations run locally. BuildBuddy cache, build event upload, downloads, and remote execution are opt-in configurations. diff --git a/justfile b/justfile index 3b993b767d..dd6771fb5b 100644 --- a/justfile +++ b/justfile @@ -121,7 +121,7 @@ bazel-lock-check: bazel mod deps --lockfile_mode=error; if ($LASTEXITCODE -ne 0) { Write-Error "MODULE.bazel.lock is out of date. Run 'just bazel-lock-update' and commit the updated lockfile."; exit 1 } bazel-test: - bazel test --test_tag_filters=-argument-comment-lint //... --keep_going + bazel test --config=local-test --test_tag_filters=-argument-comment-lint //... --keep_going [no-cd] [unix]