(tomcat) branch main updated: Fix intermittently failing test

[email protected]
Newsgroups gmane.comp.jakarta.tomcat.devel
Message-ID <178646754530.2729193.8440925332852301500@gitbox3-he-fi.apache.org>
This is an automated email from the ASF dual-hosted git repository.

markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new ab46d17074 Fix intermittently failing test
ab46d17074 is described below

commit ab46d1707413c1b75efef4c47cff2ce043cc9d0e
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Aug 11 17:58:51 2026 +0100

    Fix intermittently failing test
---
 test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java b/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java
index 0d2880701a..21b9dd113e 100644
--- a/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java
+++ b/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java
@@ -310,6 +310,11 @@ public class TestWebSocketFrameClient extends WebSocketBaseTest {
         Assert.assertEquals(HttpServletResponse.SC_OK, status);
 
         Assert.assertTrue(closeLatch.await(10, TimeUnit.SECONDS));
+        // Account for a timing window
+        int i = 0;
+        while (wsSession.isOpen() && i < 100) {
+            Thread.sleep(50);
+        }
         Assert.assertFalse(wsSession.isOpen());
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.