This is an automated email from the ASF dual-hosted git repository.
apupier pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 3e975bdcfb50 CAMEL-25891: camel-spring-xml - run the test classes in
parallel in one fork
3e975bdcfb50 is described below
commit 3e975bdcfb5075fe6223c6e39c051859a4104ff2
Author: Aurélien Pupier <[email protected]>
AuthorDate: Thu Oct 22 16:55:22 2026 +0200
CAMEL-25891: camel-spring-xml - run the test classes in parallel in one fork
Replace the previous `forkCount` 0.5C of this branch by a single fork
running
the test classes in parallel (JUnit 5 `parallel.enabled=true`, dynamic
strategy
with factor 1), which is the fastest configuration measured:
camel.surefire.forkCount=1
camel.surefire.parallel=true
camel.surefire.parallel.factor=1
Prerequisites, all merged
Running several test classes in the same JVM is only possible since the
tests
are isolated from each other, and the module is faster with the speed-ups of
the previous steps of CAMEL-25891:
- #29515: tests safe to run in parallel in one JVM (H2 generated database
name, per-context `testDirectory` property source, `@Isolated` on the JMX
tests, tolerant JMX cleanup). Without it this configuration fails with
about
115 errors.
- #29518: SEDA consumers poll every 10 ms in the tests created with
`SpringTestHelper`.
- #29553: `FastPollSedaComponent`, the same for all the other tests.
- #29556: Spring XML throttler tests in `ConcurrentRequests` mode
(`SpringThrottlerTest` 41 s -> 6 s).
Measurements
Direct comparison on the current main (all of the above included), only the
three properties differ. `camel-spring-xml`, 1186 tests (26 skipped, 0
failures in every run), each configuration run twice, alternating, same
machine. "4 vCPU CI" is simulated with `taskset -c 0-3` (the simulation
matched the real CI with the previous code: about 2'19" simulated against
2'24" real), "22 cores" is the full local machine.
4 vCPU CI 22 cores
main (4 forks, sequential) 89 s, 86 s 66 s, 64 s
this change (1 fork, parallel) 58 s, 55 s 33 s, 30 s
So the build of the module is about 35% shorter on a 4 vCPU runner and about
50% shorter on a 22 cores machine.
Other configurations measured on the same code (before this branch was
rebased on the merged PRs, 4 vCPU CI / 22 cores): 2 forks sequential 119 s;
8 forks sequential 53 s, 48 s on 22 cores; 11 forks sequential 55 s, 49 s on
22 cores; 4 forks with parallel factor 0.5 90 s / 65 s; 2 forks with
parallel
factor 1 106-109 s on 22 cores. Several forks combined with parallel classes
bring nothing or are slower (thread oversubscription is the likely reason,
not
investigated), and the 0.5C of the previous version of this branch (11
forks)
only improves on the 22 cores machine; 22 forks (1C) took 378 s on it with
the
original code because of CPU and memory contention.
Remaining limits
The 38 JMX test classes are `@Isolated` (#29515) and still run alone: 8.9 s
of class time out of 343 s (55 tests). This only covers `camel-spring-xml`,
other modules were not checked for being safe to run in parallel. To be
validated on Jenkins/CI with several runs to rule out flakiness.
Co-authored-by: IBM Bob 2.2.1
Signed-off-by: Aurélien Pupier <[email protected]>
---
components/camel-spring-parent/camel-spring-xml/pom.xml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/components/camel-spring-parent/camel-spring-xml/pom.xml
b/components/camel-spring-parent/camel-spring-xml/pom.xml
index c546123a531a..bc24fe70c083 100644
--- a/components/camel-spring-parent/camel-spring-xml/pom.xml
+++ b/components/camel-spring-parent/camel-spring-xml/pom.xml
@@ -38,8 +38,9 @@
<supportLevel>Stable</supportLevel>
<title>Spring XML</title>
- <camel.surefire.forkCount>4</camel.surefire.forkCount>
- <camel.surefire.parallel>false</camel.surefire.parallel>
+ <camel.surefire.forkCount>1</camel.surefire.forkCount>
+ <camel.surefire.parallel>true</camel.surefire.parallel>
+ <camel.surefire.parallel.factor>1</camel.surefire.parallel.factor>
<camel.surefire.forkTimeout>1800</camel.surefire.forkTimeout>
</properties>