Created by: kageiit
This adds support for splitting up jvm test suites with a large number of tests.
This can be used effectively on CI/machines with a lot of cores to run an existing large test suite in parallel by bucketing the test classes evenly. We have seen our test suite speedup from 1 hour down to 20 min by using this change.
This change usually accompanies a definition like
test_bucket_size = 200
original_java_test = java_test
def java_test(
name,
srcs=[],
**kwargs
):
splits = (len(srcs) + test_bucket_size - 1) / test_bucket_size
if splits > 1:
for part in xrange(splits):
n_name = name if part == 0 else '{}_{}'.format(name, part + 1)
original_java_test(
name=n_name,
srcs=srcs,
splits=splits,
part=part+1,
**kwargs
)
When running on CI