Author: jfrederic.clere(a)jboss.com
Date: 2009-01-23 12:50:25 -0500 (Fri, 23 Jan 2009)
New Revision: 2209
Modified:
trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestBase.java
trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestStickyForce.java
Log:
Prevent it waiting for ever.
Modified: trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestBase.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestBase.java 2009-01-23 16:51:18
UTC (rev 2208)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestBase.java 2009-01-23 17:50:25
UTC (rev 2209)
@@ -79,12 +79,14 @@
String [] nodes = new String[2];
nodes[0] = "node1";
nodes[1] = "node2";
- while (!Maintest.checkProxyInfo(cluster, nodes)) {
+ int countinfo = 0;
+ while ((!Maintest.checkProxyInfo(cluster, nodes)) && countinfo < 20)
{
try {
Thread.sleep(3000);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
+ countinfo++;
}
// Start the client and wait for it.
@@ -122,12 +124,14 @@
fail("Client error");
// Wait until httpd as received the stop messages.
- while (!Maintest.checkProxyInfo(cluster, null)) {
+ countinfo = 0;
+ while ((!Maintest.checkProxyInfo(cluster, nodes)) && countinfo < 20)
{
try {
Thread.sleep(3000);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
+ countinfo++;
}
System.gc();
}
Modified: trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestStickyForce.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestStickyForce.java 2009-01-23
16:51:18 UTC (rev 2208)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestStickyForce.java 2009-01-23
17:50:25 UTC (rev 2209)
@@ -81,12 +81,14 @@
String [] nodes = new String[2];
nodes[0] = "sticky3";
nodes[1] = "sticky4";
- while (!Maintest.checkProxyInfo(cluster, nodes)) {
+ int countinfo = 0;
+ while ((!Maintest.checkProxyInfo(cluster, nodes)) && countinfo < 20)
{
try {
Thread.sleep(3000);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
+ countinfo++;
}
// Start the client and wait for it.
@@ -149,20 +151,16 @@
}
// Wait until httpd as received the stop messages.
- try {
- Thread.sleep(5000);
- } catch (InterruptedException ex) {
- ex.printStackTrace();
- }
-/* In fact it doesn't stop correctly ... Something needs to be fixed
- while (!Maintest.checkProxyInfo(cluster, null)) {
+/* In fact it doesn't stop correctly ... Something needs to be fixed */
+ countinfo = 0;
+ while ((!Maintest.checkProxyInfo(cluster, null)) && countinfo<30) {
try {
Thread.sleep(3000);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
+ countinfo++;
}
- */
// Test client result.
if ( !clienterror && client.httpResponseCode != 503 )
Show replies by date