sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stefane...@apache.org
Subject svn commit: r1654754 - /sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/cluster/ClusterTest.java
Date Mon, 26 Jan 2015 10:19:27 GMT
Author: stefanegli
Date: Mon Jan 26 10:19:27 2015
New Revision: 1654754

URL: http://svn.apache.org/r1654754
Log:
SLING-4139 / SLING-3726 : testDuplciateInstance3726 made more robust

Modified:
    sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/cluster/ClusterTest.java

Modified: sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/cluster/ClusterTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/cluster/ClusterTest.java?rev=1654754&r1=1654753&r2=1654754&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/cluster/ClusterTest.java
(original)
+++ sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/cluster/ClusterTest.java
Mon Jan 26 10:19:27 2015
@@ -445,7 +445,7 @@ public class ClusterTest {
         // simulate a crash of instance1, resulting in load-balancer to switch the pings
         boolean success = false;
         for(int i=0; i<25; i++) {
-            // loop for max 10 times
+            // loop for max 25 times, min 15 times
             runHeartbeatOnceWith(instance2, instance3, /*instance4, */instance5);
             final boolean ping1 = pingConnector(instance3, instance2);
             final boolean ping2 = pingConnector(instance5, instance2);
@@ -453,6 +453,11 @@ public class ClusterTest {
                 // both pings were fine - hence break
                 success = true;
                 logger.info("testDuplicateInstance3726: successfully switched all pings to
instance2 after "+i+" rounds.");
+                if (i<15) {
+                    logger.info("testDuplicateInstance3726: min loop cnt not yet reached:
i="+i);
+                    Thread.sleep(500); // 25x500ms = 12.5sec max - (vs 5sec timeout)
+                    continue;
+                }
                 break;
             }
             logger.info("testDuplicateInstance3726: looping");



Mime
View raw message