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

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

commit 1b530a41d531063013856fcdd713100c4aff0ca8
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 2cfad10103..4a93167f5e 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