Local_test_resources doesn't actually restrict concurrency when `--local_test_jobs` is specified
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the bug:
I expect the `resource::amount` tag to restrict test concurrency
### Which category does this issue belong to?
Core
### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
sh_test(
name = "a",
srcs = ["test.sh"],
tags = ["resources:foo:1"],
)
sh_test(
name = "b",
srcs = ["test.sh"],
tags = ["resources:foo:1"],
)
assuming this is in the root dir, if I run `bazel test //... --local_resources=foo=1`, I'd expect test a and b to run serially, but currently they run in parallel
### Which operating system are you running Bazel on?
ubuntu 20.04
### What is the output of `bazel info release`?
release 7.1.2
### 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` ?
_No response_
### Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
_No response_
### Have you found anything relevant by searching the web?
https://github.com/bazelbuild/bazel/issues/18153
### Any other information, logs, or outputs that you want to share?
_No response_
Contributor guide
Research direction
Start with the local test scheduling path exercised by `sh_test` and the `--local_resources=foo=1` command, then compare the behavior with issue #18153. Reproduce the two-test example on Ubuntu with Bazel 7.1.2 and trace how `resources:foo:1` is handled when `--local_test_jobs` is set. Done means matching tagged tests no longer run concurrently under the stated resource limit, with regression coverage.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100