apupier opened a new pull request, #31292: URL: https://github.com/apache/camel/pull/31292
# Description Part of [CAMEL-28061](https://issues.apache.org/jira/browse/CAMEL-28061) (improve the test time of aws2 kinesis). Closing the last async client of the AWS SDK shuts down the shared Netty event loop group, and that shutdown waits for a quiet period of 2 seconds (`shutdownGracefully(2, 15, SECONDS)`). A test that builds and closes an async client, with no other one open, waits these 2 seconds. **camel-aws-bedrock**: `BedrockEndpoint.doStart()` builds a real Netty async client when none is configured, and `doStop()` closes it. 4 test classes (29 tests) only mocked the sync client, so each test waited 2 seconds. They now bind a mocked `BedrockRuntimeAsyncClient`, as `BedrockConverseTextBodyTest` and `BedrockProducerRequestTest` already do. **camel-aws2-kinesis**: 3 tests build and close a real async client on purpose (they check the region and the identity of the client the factory builds). A new JUnit extension `KeepAsyncClientOpenExtension` keeps one other async client open for the test JVM, so closing theirs returns at once. No production code and no assertion changed. | | before | after | |---|---|---| | camel-aws-bedrock, sum of test times | 61.5 s | 4.8 s | | camel-aws-bedrock, `mvn test` wall time | 73 s | 17 s | | camel-aws2-kinesis, `KinesisClientFactoryTest` + `KinesisEndpointClientTest` | 9.0 s | 0.5 s | Not in this PR: the 1 second wait of `DefaultShutdownStrategy` (CAMEL-28062), which is the other main cost of the kinesis tests. # 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. (`mvn install -DskipTests -Psourcecheck` on the 2 modules) --- _Claude-style disclosure: this description and the change were written by Bob (IBM AI coding assistant) 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]
