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 2016/02/02 15:53:38 UTC

svn commit: r1728139 - /tomcat/tc8.0.x/trunk/test/org/apache/tomcat/websocket/server/TestClose.java

Author: markt
Date: Tue Feb  2 14:53:38 2016
New Revision: 1728139

URL: http://svn.apache.org/viewvc?rev=1728139&view=rev
Log:
Align with 9.0.x

Modified:
    tomcat/tc8.0.x/trunk/test/org/apache/tomcat/websocket/server/TestClose.java

Modified: tomcat/tc8.0.x/trunk/test/org/apache/tomcat/websocket/server/TestClose.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/test/org/apache/tomcat/websocket/server/TestClose.java?rev=1728139&r1=1728138&r2=1728139&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/test/org/apache/tomcat/websocket/server/TestClose.java (original)
+++ tomcat/tc8.0.x/trunk/test/org/apache/tomcat/websocket/server/TestClose.java Tue Feb  2 14:53:38 2016
@@ -51,7 +51,6 @@ import org.apache.juli.logging.LogFactor
 /**
  * Test the behavior of closing websockets under various conditions.
  */
-//@Ignore // Only because they don't pass at the moment.
 public class TestClose extends TomcatBaseTest {
 
     private static Log log = LogFactory.getLog(TestClose.class);
@@ -283,8 +282,20 @@ public class TestClose extends TomcatBas
 
             if (events.onMessageSends) {
                 try {
+                    int count = 0;
+                    // The latches above are meant to ensure the correct
+                    // sequence of events but in some cases, particularly with
+                    // APR, there is a short delay between the client closing /
+                    // resetting the connection and the server recognising that
+                    // fact. This loop tries to ensure that it lasts much longer
+                    // than that delay so any close / reset from the client
+                    // triggers an error here.
+                    while (count < 10) {
+                        count++;
                     session.getBasicRemote().sendText("Test reply");
-                } catch (IOException e) {
+                        Thread.sleep(500);
+                    }
+                } catch (IOException | InterruptedException e) {
                     // Expected to fail
                 }
             }



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