urunni88 opened a new pull request, #27012: URL: https://github.com/apache/camel/pull/27012
# Description **JIRA:** https://issues.apache.org/jira/browse/CAMEL-24763 `testTo` failed intermittently at `assertTrue(latch.await(2, TimeUnit.SECONDS))`: the three `crs.to("bean:hello", ...)` results had not all arrived within 2 seconds. The first call includes one-time setup (bean creation, reactive-streams threads, class loading), which on a busy CI machine can exceed that window. The flux was also started with a bare `.subscribe()`, so any error was swallowed and surfaced only as a timeout. The test now waits for the stream to complete with `collectList().block(Duration.ofSeconds(30))` instead of counting down a latch. This removes the fixed time window, and any error from the stream is rethrown in the test. The 30 seconds is only an upper bound, as a normal run completes in milliseconds. `testToWithExchange`, `testToFunction` and `testToFunctionWithExchange` used the same latch pattern with the same 2 second limit, so they are changed the same way. `testFrom` is left as is, since it reads from a timer rather than a completing stream. Could not reproduce the failure locally (200 repetitions of `testTo` all passed, around 25 ms each), which fits a CI-load timing issue. `ReactorStreamsServiceTest` passes 14/14. Note: while running the whole camel-reactor module, `ReactorStreamsServiceBackpressureTest.testDropStrategy` flaked once (passed on rerun). It is an unrelated class and not changed here. AI assistance: investigation and changes were done with help from Claude (Anthropic). I reviewed and verified the changes and tests locally. # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [x] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. Built the affected module; no generated changes resulted. # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. -- 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]
