You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2024/02/13 21:38:46 UTC
(tomcat) branch 8.5.x updated: Fix test failure when serverSession is tested before it has been set
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new 4a4463ced2 Fix test failure when serverSession is tested before it has been set
4a4463ced2 is described below
commit 4a4463ced20664faca75168c5b2a028064d80f14
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 10c3a8204e..87c64c00be 100644
--- a/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
+++ b/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
@@ -207,7 +207,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) {
@@ -240,7 +240,7 @@ public class TestWsSessionSuspendResume extends WebSocketBaseTest {
}
public static boolean isServerSessionFullyClosed() {
- return serverSession.isClosed();
+ return serverSession != null && serverSession.isClosed();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org