bazelbuild / bazelbuild/bazel

--strategy_regexp does not seem to work for tests

Open
#18,196 4 comments 4 reactions 1 assignee Claimed by @meisterT View on GitHub
P2 team-Local-Exec type: bug
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the bug:

I've been trying to use the dynamic strategy to run tests but have run into some odd behavior. `--spawn_strategy=dynamic` works and makes the tests run concurrently locally and remotely via `bazel test`, but `--strategy_regexp=.*=dynamic` does not.

Obviously I'm trying with a more specific regexp than `.*`, but the point stands: the regexp matching does not seem to apply to the test actions.

Note that `bazel test --strategy_regexp=.*=dynamic` *does work* for the build actions: I can see the build making progress using the dynamic scheduler as expected. It's only the test execution that is problematic.

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

1. Write a trivial test, maybe that prints the hostname it's running on and introduces a delay depending on whether it's local or remote.
2. Run the test with `bazel test --spawn_strategy=dynamic` and see it run locally and remotely.
3. Run the test with `bazel test --strategy_regexp=.*=dynamic` and see it run remotely only (or using whichever is the default strategy).

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

N/A

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

release 6.1.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_

### 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

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.