apupier opened a new pull request, #29741:
URL: https://github.com/apache/camel/pull/29741

   ## Summary
   
   Fixes https://issues.apache.org/jira/browse/CAMEL-26897
   
   Four independent improvements to `camel-mcp-server` and 
`camel-mcp-server-api` that together cut `mvn verify` from **1m 30s to 42s** 
(−53%) and `mvn test` from ~27s to ~12s (−56%).
   
   ---
   
   ### 1 — Reduce slow-route delays in conformance kits
   
   `slow_tool` and `slow_resource` routes used `.delay(TIMEOUT * 3)` (6 s) to 
exceed the 2 s tool/resource timeout. When `CamelContext` shuts down after the 
test, `DefaultShutdownStrategy` waits up to 10 s for the still-running inflight 
exchange. Changed to `.delay(TIMEOUT + 200)` (2.2 s): the route still exceeds 
the timeout so the timeout tests pass, but the residual inflight window shrinks 
from ~4 s to ≤200 ms, saving ~4 s of shutdown wait per conformance class.
   
   ### 2 — Shorten Awaitility `during` windows in `VertxMcpSessionEvictionTest`
   
   `postOnlySessionSurvivesKeepAliveUntilIdle` and 
`activeSessionSurvivesIdleEviction` used `during(2 s).atMost(3 s)` to assert a 
session stays alive. 500 ms is sufficient to confirm no immediate eviction; the 
idle-TTL is 2–10 s — well beyond that window. Saves ~3 s total.
   
   ### 3 — Enable JUnit 5 parallel test-class execution (surefire + failsafe)
   
   Every test class creates its own Vert.x server on a fresh 
`AvailablePortFinder` port, its own `CamelContext`, and (for stdio tests) its 
own subprocess — no cross-class shared state. Added to `pom.xml`:
   - `camel.surefire.parallel=true` / `factor=1` — JUnit 5 concurrent class 
execution
   - Explicit `maven-failsafe-plugin` `configurationParameters` block with the 
same settings (the parent POM defines `camel.failsafe.parallel` but never wires 
it into failsafe's `configurationParameters`)
   
   This turns the serial 19-class unit queue and 5-class IT queue into 
fan-outs, letting the Keycloak container boot overlap with the other ITs.
   
   ### 4 — Safe port allocation with `AvailablePortFinder.find()`
   
   All tests that held a port as a `static final` field or instance-field 
initialiser using the deprecated `getNextAvailable()` — which releases the 
reservation immediately, before the server binds — are migrated to 
`AvailablePortFinder.find()`. Following the pattern from commit 
[da3c533](https://github.com/apache/camel/commit/da3c53374e32e0f82ec5b862e5bc9b471ae511c2),
 the `Port` object is:
   - **allocated** as late as possible: first line of `@BeforeAll`, or inside 
`createCamelContext()`/`customizeCamelContext()` just before the server is 
added to the context
   - **released** in the matching teardown: `@AfterAll` or `@AfterEach`
   
   This minimises the TOCTOU window between OS port probe and server bind, 
making parallel execution safe.
   
   ---
   
   ## Benchmark
   
   | Phase | Before | After | Δ |
   |-------|--------|-------|---|
   | `mvn test` (unit, 109 tests) | ~27 s | ~12 s | −56% |
   | `mvn verify` (unit + IT, 145 tests) | 1m 30s | 42s | −53% |
   
   Keycloak container was warm in both runs. On cold CI (container pull + start 
~40–60 s extra) the savings from overlapping the container boot with the other 
ITs are even larger.
   
   ---
   
   _IBM Bob 2.2.1 on behalf of 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]

Reply via email to