Author: stefanegli Date: Thu Sep 10 08:33:45 2015 New Revision: 1702185 URL: http://svn.apache.org/r1702185 Log: SLING-4991 : TopologyAnnouncementRegistryTest.testCluster failure on apache jenkins : further increasing heartbeat timeout to 10sec from 5sec
Modified: sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/setup/Instance.java sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/topology/announcement/TopologyAnnouncementRegistryTest.java Modified: sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/setup/Instance.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/setup/Instance.java?rev=1702185&r1=1702184&r2=1702185&view=diff ============================================================================== --- sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/setup/Instance.java (original) +++ sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/setup/Instance.java Thu Sep 10 08:33:45 2015 @@ -159,7 +159,7 @@ public class Instance { } - private final Logger logger = LoggerFactory.getLogger(this.getClass()); + private final static Logger logger = LoggerFactory.getLogger(Instance.class); public final String slingId; @@ -599,6 +599,10 @@ public class Instance { } public void dumpRepo() throws Exception { + dumpRepo(resourceResolverFactory); + } + + public static void dumpRepo(ResourceResolverFactory resourceResolverFactory) throws Exception { Session session = resourceResolverFactory .getAdministrativeResourceResolver(null).adaptTo(Session.class); logger.info("dumpRepo: ====== START ====="); @@ -611,8 +615,8 @@ public class Instance { session.logout(); } - - private void dump(Node node) throws RepositoryException { + + public static void dump(Node node) throws RepositoryException { if (node.getPath().equals("/jcr:system") || node.getPath().equals("/rep:policy")) { // ignore that one Modified: sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/topology/announcement/TopologyAnnouncementRegistryTest.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/topology/announcement/TopologyAnnouncementRegistryTest.java?rev=1702185&r1=1702184&r2=1702185&view=diff ============================================================================== --- sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/topology/announcement/TopologyAnnouncementRegistryTest.java (original) +++ sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/topology/announcement/TopologyAnnouncementRegistryTest.java Thu Sep 10 08:33:45 2015 @@ -36,6 +36,7 @@ import org.apache.sling.discovery.Instan import org.apache.sling.discovery.impl.Config; import org.apache.sling.discovery.impl.common.DefaultClusterViewImpl; import org.apache.sling.discovery.impl.common.DefaultInstanceDescriptionImpl; +import org.apache.sling.discovery.impl.setup.Instance; import org.apache.sling.discovery.impl.setup.MockFactory; import org.apache.sling.discovery.impl.setup.OSGiFactory; import org.apache.sling.discovery.impl.topology.TopologyTestHelper; @@ -55,8 +56,8 @@ public class TopologyAnnouncementRegistr .mockResourceResolverFactory(); config = new Config() { public long getHeartbeatTimeout() { - // 5s for tests that also run on apache jenkins - return 5; + // 10s for tests that also run on apache jenkins + return 10; }; }; slingId = UUID.randomUUID().toString(); @@ -140,7 +141,7 @@ public class TopologyAnnouncementRegistr assertTrue(registry.registerAnnouncement(ann)!=-1); assertEquals(1, registry.listInstances(localCluster).size()); - Thread.sleep(5500); + Thread.sleep(10500); assertEquals(0, registry.listInstances(localCluster).size()); } @@ -279,7 +280,7 @@ public class TopologyAnnouncementRegistr } - Thread.sleep(5500); + Thread.sleep(10500); { Announcement testAnn = createAnnouncement(myCluster, 0, false); assertEquals(1, testAnn.listInstances().size()); @@ -357,6 +358,8 @@ public class TopologyAnnouncementRegistr assertAnnouncements(registry3, myCluster, 4, 16); myCluster = createCluster(instance1, instance2); + + Instance.dumpRepo(resourceResolverFactory); assertEquals(2, registry1.listAnnouncementsInSameCluster(myCluster).size()); assertEquals(1, registry1.listLocalAnnouncements().size()); @@ -368,7 +371,7 @@ public class TopologyAnnouncementRegistr assertEquals(0, registry2.listLocalIncomingAnnouncements().size()); assertAnnouncements(registry2, myCluster, 3, 8); - Thread.sleep(5500); + Thread.sleep(10500); assertAnnouncements(registry1, myCluster, 3, 8); assertAnnouncements(registry2, myCluster, 3, 8); registry1.checkExpiredAnnouncements();