From fd671dff42215038995cc04c7790595a811b7a66 Mon Sep 17 00:00:00 2001 From: starr-openai Date: Thu, 16 Apr 2026 12:59:44 -0700 Subject: [PATCH 1/2] Throttle Windows Bazel test jobs Limit the Windows Bazel test lane to 8 jobs to reduce local runner pressure, and make failed-test log tailing resolve paths using the same CI config and Windows host-platform context as the failed invocation. Co-authored-by: Codex --- .github/scripts/run-bazel-ci.sh | 23 +++++++++++++++++++++-- .github/workflows/bazel.yml | 12 ++++++++---- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/.github/scripts/run-bazel-ci.sh b/.github/scripts/run-bazel-ci.sh index c8c09f406a65..2f43879a4756 100755 --- a/.github/scripts/run-bazel-ci.sh +++ b/.github/scripts/run-bazel-ci.sh @@ -69,12 +69,30 @@ print_bazel_test_log_tails() { local console_log="$1" local testlogs_dir local -a bazel_info_cmd=(bazel) + local -a bazel_info_args=(info) if (( ${#bazel_startup_args[@]} > 0 )); then bazel_info_cmd+=("${bazel_startup_args[@]}") fi - testlogs_dir="$(run_bazel "${bazel_info_cmd[@]:1}" info bazel-testlogs 2>/dev/null || echo bazel-testlogs)" + if [[ -n "${BUILDBUDDY_API_KEY:-}" ]]; then + bazel_info_args+=( + "--config=${ci_config}" + "--remote_header=x-buildbuddy-api-key=${BUILDBUDDY_API_KEY}" + ) + fi + for arg in "${post_config_bazel_args[@]}"; do + case "$arg" in + --host_platform=* | --repo_contents_cache=* | --repository_cache=*) + bazel_info_args+=("$arg") + ;; + esac + done + + testlogs_dir="$(run_bazel "${bazel_info_cmd[@]:1}" \ + --noexperimental_remote_repo_contents_cache \ + "${bazel_info_args[@]}" \ + bazel-testlogs 2>/dev/null || echo bazel-testlogs)" local failed_targets=() while IFS= read -r target; do @@ -95,8 +113,9 @@ print_bazel_test_log_tails() { rel_path="${rel_path/://}" local test_log="${testlogs_dir}/${rel_path}/test.log" local reported_test_log - reported_test_log="$(grep -F "FAIL: ${target} " "$console_log" | sed -nE 's#.* \(see ([^)]+/test\.log)\).*#\1#p' | head -n 1 || true)" + reported_test_log="$(grep -F "FAIL: ${target} " "$console_log" | sed -nE 's#.* \(see (.*[\\/]test\.log)\).*#\1#p' | head -n 1 || true)" if [[ -n "$reported_test_log" ]]; then + reported_test_log="${reported_test_log//\\//}" test_log="$reported_test_log" fi diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 5d30916f9fc3..0328ac207368 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -86,17 +86,21 @@ jobs: --print-failed-test-logs --use-node-test-env ) + bazel_test_args=( + test + --test_tag_filters=-argument-comment-lint + --test_verbose_timeout_warnings + --build_metadata=COMMIT_SHA=${GITHUB_SHA} + ) if [[ "${RUNNER_OS}" == "Windows" ]]; then bazel_wrapper_args+=(--windows-msvc-host-platform) + bazel_test_args+=(--jobs=8) fi ./.github/scripts/run-bazel-ci.sh \ "${bazel_wrapper_args[@]}" \ -- \ - test \ - --test_tag_filters=-argument-comment-lint \ - --test_verbose_timeout_warnings \ - --build_metadata=COMMIT_SHA=${GITHUB_SHA} \ + "${bazel_test_args[@]}" \ -- \ "${bazel_targets[@]}" From ad6c19b41d2bd8b717ed90e2b1b16cd154060c14 Mon Sep 17 00:00:00 2001 From: starr-openai Date: Thu, 16 Apr 2026 13:59:52 -0700 Subject: [PATCH 2/2] Explain Bazel log tail config Document why failed-test log tailing runs bazel info with matching CI config and only selected post-config args. Co-authored-by: Codex --- .github/scripts/run-bazel-ci.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/scripts/run-bazel-ci.sh b/.github/scripts/run-bazel-ci.sh index 2f43879a4756..a1d42a057639 100755 --- a/.github/scripts/run-bazel-ci.sh +++ b/.github/scripts/run-bazel-ci.sh @@ -75,12 +75,19 @@ print_bazel_test_log_tails() { bazel_info_cmd+=("${bazel_startup_args[@]}") fi + # `bazel info` needs the same CI config as the failed test invocation so + # platform-specific output roots match. On Windows, omitting `ci-windows` + # would point at `local_windows-fastbuild` even when the test ran with the + # MSVC host platform under `local_windows_msvc-fastbuild`. if [[ -n "${BUILDBUDDY_API_KEY:-}" ]]; then bazel_info_args+=( "--config=${ci_config}" "--remote_header=x-buildbuddy-api-key=${BUILDBUDDY_API_KEY}" ) fi + # Only pass flags that affect Bazel's output-root selection or repository + # lookup. Test/build-only flags such as execution logs or remote download + # mode can make `bazel info` fail, which would hide the real test log path. for arg in "${post_config_bazel_args[@]}"; do case "$arg" in --host_platform=* | --repo_contents_cache=* | --repository_cache=*)