This is an automated email from the ASF dual-hosted git repository. markt 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 d7daf694cb Fix test failure when serverSession is tested before it has been set d7daf694cb is described below commit d7daf694cbd773e362567a29a3b518cc1edaa9c1 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