Skip to content

KSQL-14879 | Run ksqldb-functional-tests surefire in parallel across 8 forks - #11017

Open
Parag Badani (pbadani) wants to merge 8 commits into
8.1.xfrom
KSQL-14879-parallel-functional-tests
Open

KSQL-14879 | Run ksqldb-functional-tests surefire in parallel across 8 forks#11017
Parag Badani (pbadani) wants to merge 8 commits into
8.1.xfrom
KSQL-14879-parallel-functional-tests

Conversation

@pbadani

Copy link
Copy Markdown
Member

Summary

  • Adds maven-surefire-plugin config to ksqldb-functional-tests/pom.xml to run test classes in parallel
  • forkCount=8, parallel=classes allows QueryTranslationTest (~64min) and PlannedTestsUpToDateTest (~60min) to run concurrently instead of sequentially
  • Increases per-fork heap from root pom default of 1GB to 2GB to reduce GC pressure (8 forks × 2GB = 16GB, fits within the 32GB on s1-prod-ubuntu24-04-amd64-3)
  • Expected reduction: ksqldb-functional-tests module wall time 2h 41min → ~65min; overall build 3h 52min → ~1h 15min

Test plan

  • Verify CI build passes on this branch
  • Confirm QueryTranslationTest and PlannedTestsUpToDateTest run concurrently in the build log
  • Check no test failures introduced by parallel execution (tests use TestExecutor.create() which is fully isolated — no shared Kafka cluster or static state)

Jira: https://confluentinc.atlassian.net/browse/KSQL-14879

🤖 Generated with Claude Code

@pbadani
Parag Badani (pbadani) requested a review from a team as a code owner April 29, 2026 11:23
@confluent-cla-assistant

Copy link
Copy Markdown

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

@airlock-confluentinc
airlock-confluentinc Bot force-pushed the KSQL-14879-parallel-functional-tests branch from 2c11a9c to 51df28f Compare April 29, 2026 11:25
Parag Badani (pbadani) and others added 8 commits May 19, 2026 14:29
…8 forks

QueryTranslationTest (64min) and PlannedTestsUpToDateTest (60min) previously
ran sequentially in a single JVM on the s1-prod-ubuntu24-04-amd64-3 agent
(16 CPU, 32GB RAM). With parallel=classes and forkCount=8 they run concurrently,
reducing ksqldb-functional-tests wall time from ~2h41m to ~65min. Each fork
gets 2GB heap (up from the root pom default of 1GB) to reduce GC pressure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Enables Maven parallel module builds using one thread per CPU core.
On the s1-prod-ubuntu24-04-amd64-3 agent (16 cores) this parallelizes
independent modules that are off the critical path, saving ~12min.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…es each

QueryTranslationTest (~64 min) and PlannedTestsUpToDateTest (~60 min) are the
two dominant tests in ksqldb-functional-tests. Batch-splitting them into 8
concurrent subclasses each (following the RestQueryTranslationTestBatch pattern)
brings wall-clock time for the module from ~120 min to ~10 min on a 16-core
machine. forkCount raised to 16 to utilize all cores; heap reduced to 1500m
per fork to stay within 32GB RAM (16 × 1.5GB = 24GB).

Shared state audit confirmed full isolation: TopologyTestDriver is in-memory,
StubKafkaService and TestExecutor are created fresh per test via try-with-resources,
and all static fields in loader/utility classes are immutable constants.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The root pom defaults multi-threaded-testing.forkCount=3, but
ksqldb-functional-tests has 4 RestQueryTranslationTest batches. With
only 3 concurrent forks, 3 batches run in parallel and the 4th runs
alone in a second wave, doubling the wall-clock time for the failsafe
integration-test phase. Setting forkCount=4 in this module allows all
4 batches to run concurrently.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SpotBugs is bound to the compile phase with effort=Max and runs on every
module (~29 modules) during every test build. It is static analysis — it
adds no value to test correctness — and is better suited to a dedicated
analysis job or a scheduled run. Skipping it in the Test block removes
bytecode analysis overhead from the critical path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
….2.5

ksqldb-engine has 370 unit test classes running single-threaded (root pom
default). Adding forkCount=4 + parallel=classes + useUnlimitedThreads
distributes them across 4 JVMs with class-level thread parallelism.

Shared state audit confirmed safety: all embedded-Kafka tests are
@category(IntegrationTest) excluded from surefire; UdfLoaderTest's
SecurityManager mutation is per-test save/restore with a permissive
AllPermission policy; KsqlEngineTest's static FunctionRegistry is
write-once in @BeforeClass then read-only.

Also pins maven-surefire-plugin to version 3.2.5 in ksqldb-engine and
ksqldb-functional-tests to match the root pom.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Surefire's default includes (*Test.java, Test*.java, etc.) do not match
QueryTranslationTestBatch0.java or PlannedTestsUpToDateTestBatch0.java
since they end with Batch<N> rather than Test. All 16 batch classes were
silently skipped, causing 4237 tests (2342 QTT + 1895 Planned) to drop
from the reported count. Adding **/*Batch*.java to the explicit includes
list (alongside the reinstated defaults) restores full coverage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… forkCount=4

13 integration test classes in ksqldb-engine were running serially via the
default failsafe integration-test execution (forkCount=1). Each class uses
EmbeddedSingleNodeKafkaCluster with port=0 (random ephemeral ports) so there
is no shared state or port conflict — all 13 classes are safe to run in
parallel.

Adding forkCount=4 with reuseForks=false reduces 13 serial embedded-Kafka
startups to 4 concurrent batches, cutting ksqldb-engine integration test
wall-clock time by ~3x. This unblocks ksqldb-functional-tests, which cannot
start until ksqldb-engine is fully built and tested.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@airlock-confluentinc
airlock-confluentinc Bot force-pushed the KSQL-14879-parallel-functional-tests branch from 12ceaab to d08c217 Compare May 19, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant