How are tests parallelized, how do they know the number of threads they can run on?

1,150 views
Skip to first unread message

jamesf...@gmail.com

unread,
Apr 9, 2015, 11:48:56 PM4/9/15
to bazel-...@googlegroups.com
How are tests parallelized, how do they know the number of threads they can run on?

Thanks,
James

Damien Martin-guillerez

unread,
Apr 10, 2015, 2:49:02 AM4/10/15
to jamesf...@gmail.com, bazel-...@googlegroups.com, phi...@google.com, ulf...@google.com
CC +Philipp Wollermann +Ulf Adams

Tests can be sharded by setting the shard_count attribute. Each shard would run in a  separate thread. //src/test/shell/bazel:base_workspace_test is supposed to have shard_count set to 3 (src/test/shell/unitbash.sh selects the test to run depending on the shard number). However, there is a bug in shell test sharding for now, I have got time to fix it now.

For JUnit tests (Philip and Ulf knows that better), I believe the sharding support should Just Work if you set the shard_count attribute but I doubt we did test it in Bazel.

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to bazel-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/c1deb77d-754e-4501-81bd-fcf452b0dc6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Philipp Wollermann

unread,
Apr 10, 2015, 3:04:09 AM4/10/15
to Damien Martin-guillerez, jamesf...@gmail.com, bazel-...@googlegroups.com, ulf...@google.com
AFAIK test sharding for JUnit tests will not work in Bazel yet, as we haven't open-sourced our full-featured JUnit test runner yet. I'm on that right now :)

Cheers,
Philipp

Han-Wen Nienhuys

unread,
Apr 10, 2015, 4:01:51 AM4/10/15
to jamesf...@gmail.com, bazel-...@googlegroups.com
As Damien and Philipp mentioned, we start up N copies of the test, and
each copy runs a different set of tests. This needs support from the
language specific test runners, and may have bugs.
> --
> You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
> To post to this group, send email to bazel-...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/c1deb77d-754e-4501-81bd-fcf452b0dc6c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Han-Wen Nienhuys
Google Munich
han...@google.com
Reply all
Reply to author
Forward
0 new messages