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

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

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


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

commit b9266ad32775fb0fbba336a7cd43d11d36d46f38
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.