apupier commented on code in PR #29574:
URL: https://github.com/apache/camel/pull/29574#discussion_r4529639679
##########
components/camel-http/src/test/java/org/apache/camel/component/http/BaseHttpTest.java:
##########
@@ -56,4 +58,16 @@ protected void assertBody(String body) {
protected String getExpectedContent() {
return "camel rocks!";
}
+
+ /**
+ * Closes the servers without waiting for their open (keep-alive)
connections: the graceful close of an
+ * {@link HttpServer} waits up to 5 seconds for them to terminate.
+ */
+ protected static AutoCloseable closeImmediately(HttpServer... servers) {
+ return () -> {
+ for (HttpServer server : servers) {
+ server.close(CloseMode.IMMEDIATE);
+ }
+ };
+ }
Review Comment:
Good catch, fixed in 1e9ce4a4784b: `closeImmediately` now skips `null`
servers, so a failing `setupResources()` is no longer masked by an NPE in
`cleanupResources()`.
_AI-generated reply by 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]