Add support for build/test priority values so that users can, for example, have long tests start earlier in the flow #24903
Labels
team-Configurability
platforms, toolchains, cquery, select(), config transitions
team-Performance
Issues for Performance teams
team-Remote-Exec
Issues and PRs for the Execution (Remote) team
type: feature request
untriaged
Description of the feature request:
Migrated from an Google Bazel Users chatroom topic on 2024-12-09.
I would like to be able to tell Bazel to start particular targets earlier on in the build/test process, because I know that these targets will take longer to build/test than others.
For example:
The "priority" attribute would help Bazel schedule which builds/tests to run first. As a simple example, imagine two workers running 4 tests (defined above). There are many ways that the 4 tests get run on 2 workers, but here are two examples:
When the "long" test
D
is run first, the total time to run is 4 time units shorter.Obviously this is not really relevant with 4 targets and 2 workers, but the overall time reduction can be significant when you have a bunch of targets, a bunch of workers, and multiple targets that take a long time to test.
Other notes:
priority = 9000
to make sure it's done before others.priority = -1
could mean "default" but it might be harder to place. Is the default 4500?Which category does this issue belong to?
Configurability, Performance, Remote Execution
What underlying problem are you trying to solve with this feature?
As I understand it, builds and tests are run in a pseduo-randomized order. Obviously dependencies are built first, but assuming N targets have completely independent dep trees, there is nothing that say "prioritize building target A before target B".
We have O(1400) test targets and typically run with 40 workers. Some of our tests take 10 minutes to complete. If that test happens to get started at then end of the process, then we end up waiting for that one worker. If the test was started first, then it would complete while all the other small tests are running.
Which operating system are you running Bazel on?
gLinux
What is the output of
bazel info release
?release 7.4.1
If
bazel info release
returnsdevelopment 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
?Have you found anything relevant by searching the web?
I had a small chat with @rickeylev about this in the Google Bazel Users chat. Here's the transcript:
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: