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

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

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


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

commit 98c5cb1bc17c9deb27bad076d45ed3b32624a534
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.