This is an automated email from the ASF dual-hosted git repository.

markt 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 4ce922d872 Fix test failure when serverSession is tested before it has 
been set
4ce922d872 is described below

commit 4ce922d87275154fea252a155b8d43d499c4283f
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Feb 13 21:38:39 2024 +0000

    Fix test failure when serverSession is tested before it has been set
---
 test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java 
b/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
index f624f5c87c..6a8aad06d8 100644
--- a/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
+++ b/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
@@ -196,7 +196,7 @@ public class TestWsSessionSuspendResume extends 
WebSocketBaseTest {
     public static final class SuspendCloseEndpoint extends Endpoint {
 
         // Yes, a static variable is a hack.
-        private static WsSession serverSession;
+        private static volatile WsSession serverSession;
 
         @Override
         public void onOpen(Session session, EndpointConfig epc) {
@@ -226,7 +226,7 @@ public class TestWsSessionSuspendResume extends 
WebSocketBaseTest {
         }
 
         public static boolean isServerSessionFullyClosed() {
-            return serverSession.isClosed();
+            return serverSession != null && serverSession.isClosed();
         }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to