Aurélien Pupier created CAMEL-27461:
---------------------------------------
Summary: camel-spring-boot - Support parallel build (-T1C) in CI
and enable Develocity to track flaky tests
Key: CAMEL-27461
URL: https://issues.apache.org/jira/browse/CAMEL-27461
Project: Camel
Issue Type: Task
Components: camel-spring-boot
Reporter: Aurélien Pupier
Assignee: Aurélien Pupier
Fix For: 4.24.0
h3. Goal
Reduce the duration of the camel-spring-boot CI build by running Maven in
parallel ({{-T1C}}), and make the build reliable enough to do so. As
prerequisites we need to enable Develocity (the Apache instance,
https://develocity.apache.org, already used by apache/camel) to track flaky
tests, then fix them.
h3. Benchmarks
Build of {{origin/main}} (a350cc35423), same command as {{Jenkinsfile.sb}} (+
{{-Dmaven.test.failure.ignore=true clean install}}, JDK 21.0.9 Temurin, 478
reactor modules, 2836 tests, warm {{~/.m2}} and container images). Local
machine: 22 cores / 30 GB RAM. The "4 cores" runs use {{taskset -c 0-3}} to
mimic the 4 cores of the CI agent (Maven then reports a thread count of 4).
|| Run || CPU cores || Wall time || Tests run / failed / skipped || Flaky tests
(rerun passed) ||
| sequential (warmup, fills ~/.m2) | 22 | 33m13s | 2836 / 1 / 15 | - |
| sequential | 22 | 32m08s | 2836 / 1 / 15 | 2 |
| {{-T1C}} (22 threads) | 22 | 17m06s | 2836 / 1 / 15 | 5 |
| sequential | 4 | 47m44s | 2836 / 1 / 15 | 2 |
| {{-T1C}} (4 threads) | 4 | 32m45s | 2836 / 1 / 15 | 2 |
h4. Findings
* On a 4 cores agent, {{-T1C}} saves about 15 minutes (-31%, 1.46x faster)
compared to the sequential build, which is the CI configuration today. With 22
cores the saving is also about 15 minutes (-47%).
* Parallelism does not change the number of executed tests nor the number of
failures. The single failure present in every run, including the sequential
ones, is unrelated to parallelism (a catalog coverage check in
{{CamelCatalogIT}}).
* Flaky tests (passing on surefire rerun): {{FromFtpFilterTest}} and
{{FtpProducerConcurrentTest}} are flaky in all the runs, including the
sequential ones. With 22 threads, three more became flaky
({{SpringBootPlatformHttpCertificationTest}},
{{SpringBootPlatformHttpOptionsTest}}, {{SpringBootMcpServerTest}}). They did
not show up with 4 threads but they are a risk (more agents, more cores).
* The module {{tests/camel-itest-spring-boot}} (405 starter integration tests,
failsafe {{forkCount=0.5C}}, {{reuseForks=false}}, each building a project
generated from the archetype) is the bottleneck: ~26 min of the sequential
build and ~32 min of the 32m45s of the {{-T1C}} build on 4 cores. It is the
first axis of improvement.
h3. Axes of improvement
# Add {{-T1C}} to the {{MAVEN_PARAMS}} of {{Jenkinsfile.sb}} (immediate gain of
~15 min on 4 cores), once the flaky tests are fixed or at least tracked.
# Shorten the critical path of the {{tests/camel-itest-spring-boot}} module:
start it earlier in the reactor, review {{forkCount}}/{{reuseForks}} for a 4
cores agent, avoid rebuilding what is shared between the generated projects.
# Check the memory footprint with parallel forks ({{.mvn/jvm.config}} has
{{-Xmx3584m}}, and the build uses {{-Dmaven.compiler.fork=true}}) on the real
agent.
# Look at the slowest modules of the reactor summary once the integration tests
are not the limiting factor.
h3. Plan
# Activate Develocity (same instance and conventions as apache/camel) to track
the builds and the flaky tests: dedicated sub-task.
# One sub-task per flaky test to fix.
# Enable {{-T1C}} in {{Jenkinsfile.sb}} and validate on the real CI agent.
# Optimize the integration tests module.
_AI-generated by IBM Bob on behalf of Aurélien Pupier._
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)