Build: Allow overriding the default test parallelism of 1 #13675
+14
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the
testParallelism
property which allows to set the number of Gradle workers for test tasks. The default remains 1 worker (no concurrency).I found myself frequently editing the
test
section of the Flink build files to speed up the build. This PR allows everyone in Iceberg to selectively increase the test parallelism.Why?
While the build tasks run in parallel, there is no concurrency on the individual build tasks. By far, tests take the longest time to execute. Running them in parallel yields a speedup of at least 2. Locally, speedups of 3 are possible. In CI, the speedup is also above 2. See the test results below.
How?
Set the number of test workers to a fixed number:
Enable auto-mode, which sets the test parallelism to
availableCPUs / 2
:Test results
Local
On my machine (MacBook Pro M1 Max):
Note:
GitHub CI
In this PR, I enabled the flag to run Flink tests. I don't know how many cores we have available in CI, so I tested only with the status quo (
testParallelism=1
) and the auto-mode set tonumCpus
andnumCpus/2
(the latter is what I propose as the default for the auto mode).In CI, using all available CPUs performed better than using only half. Nevertheless, I would prefer to use the more conservative value of
numCpus / 2
for the auto mode. This still gives a speedup of more than 2.