bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Scheduling tests that require exclusive access to limited resources

Open peakschris opened this issue 6 months ago • 1 comments

Description of the feature request:

We have hundreds of tests and each requires exclusive access to a preinstalled database. There are around 10 different preinstalled databases and each test requires a specific one. Multiple tests can run at the same time as long as they are accessing different databases. Only one test can run against a specific database at a time.

The databases are preinstalled prior to running bazel. A specific database is selected by passing an envvar to the test.

Currently we are running tests with bazel sequentially which works but it slow.

Is this possible to model in bazel the exclusive resource dependency so that tests will run in parallel where possible?

We are initially trying to get this working with local execution, but would like to move to remote test execution in future.

Thanks!

Which category does this issue belong to?

Local Execution, Core

What underlying problem are you trying to solve with this feature?

Better test scheduling

Which operating system are you running Bazel on?

No response

What is the output of bazel info release?

8.2.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 HEAD ?


Have you found anything relevant by searching the web?

No response

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

No response

peakschris avatar Jun 12 '25 21:06 peakschris

previously: https://github.com/bazelbuild/bazel/issues/12467

pcjanzen avatar Jun 13 '25 13:06 pcjanzen

Have you tried using --local_resources flag and defining your own custom resource?

zhengwei143 avatar Jun 17 '25 13:06 zhengwei143