apupier opened a new pull request, #30210: URL: https://github.com/apache/camel/pull/30210
## Summary Follow-up of #29701 (CAMEL-26818). `camel-jbang-core` is on the critical path of the Jenkins build (build 2470: 4:03 to 8:23 min), and the serial-test fork was still the bottleneck: it ran 269 tests, and `ExportTest` alone took about 60 s locally (104-212 s on Jenkins). The module also used about 10 min of CPU on 22 cores for 2 min of wall time, which hurts when the CI machine builds other modules at the same time (`-T1C`). ## Changes All in `camel-jbang-core`, tests and test configuration only. - **`ExportTest` per method instead of per class.** `@UsesWorkingDirectory` and `@UsesFixedPort` now accept a method (`@Target` TYPE and METHOD), and `ExportTest` no longer carries the class annotation. - **No more `./application.properties` in the shared module directory.** The 3 `ExportTest` tests that wrote it, plus `ExportMainJibTest`, `ExportMainJkubeTest` and `ExportMainApplicationPropertiesTest`, write it into a temporary base directory of their own and pass it as `exportBaseDir`. - **No more fixed port 8080.** The `--console` tests (and the `maven-quarkus-dev` case of `RunExportGoldenTest`) export with `--port=0`. The golden file `maven-quarkus-dev.maven.txt` gains `quarkus.http.port=0` and `quarkus.management.port=0`, nothing else. - **`RunExportGoldenTest` runs in the parallel forks.** It has a work directory of its own per test (`CamelHome.useWorkDir`), and `normalize()` maps it back to `.camel-jbang`, so the other golden files are unchanged. - **Cheaper JVMs in the forks.** `-XX:TieredStopAtLevel=1 -XX:+UseSerialGC` through `camel.surefire.fork.additional-vmargs`. Measured on their own, the C1 flag gives the CPU saving and SerialGC adds almost none. A higher `forkCount` (8, 12) did not help. - `AGENTS.md` of the module says that the annotations go on a single method. The serial fork now has 53 tests (`LoadTest`, `EvalSimpleTest` which is disabled on CI, `InfraTest`, `InfraRestartTest`, `BaseConfigTestSupport`). ## Measurements Local, same machine, `taskset`-pinned, port 8080 free, all tests green (3310 + 53 after, 3094 + 269 before): | | before | after | |---|---|---| | 22 CPUs, wall | 150 s | 116 s | | 22 CPUs, CPU | 9 min 52 s | 5 min 42 s | | 4 CPUs, wall | 184 s | 131 s | | 4 CPUs, CPU | 7 min 57 s | 5 min 39 s | The wall gain comes from the `ExportTest` and `RunExportGoldenTest` changes; the CPU gain comes from the JVM flags. The Jenkins effect is not measured yet: this is expected to help most where the CPU is saturated. Note for reviewers: a local Jenkins container on port 8080 made the original serial tests fail with `Address already in use` (14 errors in the baseline run). This PR removes that dependency on the port for the export tests. ## Related https://issues.apache.org/jira/browse/CAMEL-26818 --- _AI-assisted: IBM Bob 2.2.1 on behalf of Aurélien Pupier (@apupier)._ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
