apupier commented on code in PR #30432:
URL: https://github.com/apache/camel/pull/30432#discussion_r4639962191


##########
components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/KubernetesInformerLoopTest.java:
##########
@@ -67,11 +67,20 @@ void setUp() {
     void tearDown() throws Exception {
         service.stop();
         if (thread != null) {
+            // Stop the loop (stops the informer, releases the wait latch) and 
join the thread.
             loop.stop();
             thread.join(20000);
         }
         client.close();
-        server.destroy();
+        // server.destroy() may time out waiting for a WebSocket that 
fabric8's informer opened during
+        // reconnect and has not yet closed after informer.stop(): fabric8 
cancels the HTTP streaming
+        // request asynchronously, so the server may still see an open 
connection. The test body has
+        // already passed at this point; suppress the cleanup exception so the 
test is not marked as
+        // failed for a teardown race that the test infrastructure cannot 
reliably control.
+        try {
+            server.destroy();
+        } catch (IllegalStateException ignored) {
+        }

Review Comment:
   I think we should provide a log and not completely swallow the exception



-- 
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