bazelbuild / bazelbuild/bazel

Primary output of TestRunner actions in Bazel profile is inconsistent with RBE

Open
#27,294 0 comments 0 reactions 0 assignees View on GitHub
P3 team-Remote-Exec type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the bug:

With `experimental_profile_include_primary_output` enabled, Bazel profile spans will include the names of primary output files.

For TestRunner action spans, the primary output is `.../test.log`.
However, such a file does not exist in the RBE Execution request.

This made it really problematic for us to correlate TestRunner spans and the remote actions metadata, especially when they live under the same target. (i.e. test with multiple runs, shards and platform transitions).

### Which category does this issue belong to?

_No response_

### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Run a `bazel test` with `--experimental_profile_include_primary_output` and inspect the profile.

### Which operating system are you running Bazel on?

_No response_

### What is the output of `bazel info release`?

_No response_

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

_No response_

### What's the output of `git remote get-url origin; git rev-parse HEAD` ?

```text

```

### If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

_No response_

### Have you found anything relevant by searching the web?

Perhaps, specifically for TestRunner actions, we can agree by convention to use `test.output` (the undeclared output directory) as the primary output instead of the `test.log` file. Because the directory is always created as part of RBE input, it's relatively safe to assume that it always exists.

### Any other information, logs, or outputs that you want to share?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by running bazel test with --experimental_profile_include_primary_output and inspect the generated profile alongside the RBE Execution request. Trace how TestRunner action spans choose their primary output and compare that with the remote action metadata. Done means the primary output identifier is consistent between the profile and RBE request, including tests with multiple runs, shards, or platform transitions.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.