Skip to content

Shard CI tests and raise the surefire fork count - #3079

Open
cgivre wants to merge 1 commit into
apache:masterfrom
cgivre:ci-shard-tests
Open

Shard CI tests and raise the surefire fork count#3079
cgivre wants to merge 1 commit into
apache:masterfrom
cgivre:ci-shard-tests

Conversation

@cgivre

@cgivre cgivre commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Description

The unit test suite dominates CI wall clock time, and exec/java-exec alone accounts for roughly half of it (~31 minutes across 577 classes).

This splits each matrix entry three ways by test class name and runs two surefire forks per job:

  • Sharding — a Select test shard step maps matrix.shard to a -Dtest=... pattern list. Boundaries were picked from measured per-class times; the longest shard is about 11 minutes.
  • -DforkCount=2 — several of the slowest classes are wall-clock bound rather than CPU bound (TestTimedCallable sleeps for 105 seconds; the RPC, SSL and graceful-shutdown tests wait on timeouts), so a second fork overlaps that idle time cheaply. Raising it further needs memory headroom — the vector tests fail with OutOfMemoryException under pressure.

Two things worth calling out in review:

  • The patterns are spelled out one prefix at a time because surefire does not support character-class globs. -Dtest='Test[A-F]*' silently matches nothing and the build passes green having run no tests, so only * wildcards and comma separated lists are used.
  • The patterns are exhaustive over every test class in the repo, verified mechanically, so a newly added test always lands in a shard rather than being skipped without warning. Shard 3 repeats surefire's other default includes (*Test, *Tests, *TestCase) to pick up classes not named Test*. TestFrameworkTest matches shards 1 and 3 and runs twice — harmless, and far safer than a gap.

-Dsurefire.failIfNoSpecifiedTests=false is needed because most modules match no pattern in a given shard.

Documentation

N/A — CI configuration only.

Testing

CI on this PR is the test: all nine jobs (3 Java versions x 3 shards) must pass, and between them they run the same set of test classes as the previous single job.

The unit test suite dominates CI wall clock, and exec/java-exec alone accounts
for roughly half of it. Split each matrix entry three ways by test class name
and run two surefire forks per job.

The shard patterns are exhaustive over every test class in the repo, so a newly
added test always lands in a shard instead of being silently skipped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant