bazelbuild / bazelbuild/bazel

`--test_output=streamed` does not run actions locally, but prints message saying that it does

Open
#19,428 3 comments 2 reactions 0 assignees View on GitHub
team-Core type: bug untriaged
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 18h
Merged PRs (30d)
75

Description

### Description of the bug:

When running a `bazel test` with `--test_output=streamed`, it prints a warning saying that all actions will be run locally, one at a time.

However, this doesn't seem to be the case. It is spawning some actions remotely. See "2 processes: 2 remote" in the following log:

```
$ bazel --ignore_all_rc_files test :all --bes_backend=remote.buildbuddy.io --bes_results_url=https://app.buildbuddy.io/invocation/ --
remote_executor=remote.buildbuddy.io --test_output=streamed --nocache_test_results
INFO: Invocation ID: 670d3ef0-c206-4c08-b291-7ba0107369c9
INFO: Streaming build results to: https://app.buildbuddy.io/invocation/670d3ef0-c206-4c08-b291-7ba0107369c9
WARNING: Streamed test output requested. All tests will be run locally, without sharding, one at a time
INFO: Analyzed 2 targets (0 packages loaded, 0 targets configured).
INFO: Found 1 target and 1 test target...
INFO: Elapsed time: 8.543s, Critical Path: 8.35s
INFO: 2 processes: 2 remote.
//:pass PASSED in 1.1s

Executed 1 out of 1 test: 1 test passes.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.
INFO: Streaming build results to: https://app.buildbuddy.io/invocation/670d3ef0-c206-4c08-b291-7ba0107369c9
INFO: Build completed successfully, 2 total actions
```

I have come to see this as expected behavior: when running with `--test_output=streamed` my expectation is that it'll disable remote execution, which makes sense because the remote API doesn't support action stdout/stderr streaming if I understand correctly. So I think it's a bug that `--test_output=streamed` is not actually forcing local execution.

### Which category does this issue belong to?

Core, Local Execution, Remote Execution

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

Set up a basic `sh_test` that just does `exit 0` then run the following command:

```
bazel --ignore_all_rc_files test :all --bes_backend=remote.buildbuddy.io --bes_results_url=https://app.buildbuddy.io/invocation/ --remote_executor=remote.buildbuddy.io
```

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

Ubuntu 20.04

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

release 6.3.1

### 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 master; git rev-parse HEAD` ?

_No response_

### Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

I have been able to repro as far back as 3.0.0. Haven't tried earlier versions.

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

_No response_

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

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Ubuntu 20.04 example with Bazel 6.3.1, using --test_output=streamed together with --remote_executor and inspecting the process summary. Trace the handling of streamed test output and remote execution; done means the warning matches actual execution behavior and a regression test covers the remote-execution case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.