Author: markt
Date: Thu Apr 28 11:11:23 2016
New Revision: 1741409
URL: http://svn.apache.org/viewvc?rev=1741409&view=rev
Log:
Fix another root cause of this test failing (primarily on Gump).
If the server is really slow (and Gump is) the session might not have been
opened by the time the test checked to see if it had been closed. This led to a
failure since the server code was still processing when the test ended.
Modified:
tomcat/trunk/test/org/apache/tomcat/websocket/server/TestCloseBug58624.java
Modified:
tomcat/trunk/test/org/apache/tomcat/websocket/server/TestCloseBug58624.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/server/TestCloseBug58624.java?rev=1741409&r1=1741408&r2=1741409&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/websocket/server/TestCloseBug58624.java
(original)
+++ tomcat/trunk/test/org/apache/tomcat/websocket/server/TestCloseBug58624.java
Thu Apr 28 11:11:23 2016
@@ -60,10 +60,20 @@ public class TestCloseBug58624 extends W
URI uri = new URI("ws://localhost:" + getPort() +
Bug58624ServerConfig.PATH);
Session session = wsContainer.connectToServer(client, uri);
+
+ // Wait for session to open on the server
+ int count = 0;
+ while (count < 50 && Bug58624ServerEndpoint.getOpenSessionCount() ==
0) {
+ count++;
+ Thread.sleep(100);
+ }
+ Assert.assertNotEquals(0,
Bug58624ServerEndpoint.getOpenSessionCount());
+
+ // Now close the session
session.close();
// Wait for session to close on the server
- int count = 0;
+ count = 0;
while (count < 50 && Bug58624ServerEndpoint.getOpenSessionCount() > 0)
{
count++;
Thread.sleep(100);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]