(tomcat) branch 9.0.x updated: Fix intermittently failing test

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 41bf65f2cc Fix intermittently failing test
41bf65f2cc is described below

commit 41bf65f2cc565f4e8fc259d6bc00ced3f3f7b78e
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 9bbfa30339..fa5a5f4600 100644
--- a/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java
+++ b/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java
@@ -311,6 +311,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.