Related to issue 38888: Failing SS Build
authorMartin Taal <martin.taal@openbravo.com>
Mon, 26 Nov 2018 12:12:34 +0100
changeset 7908 916c79b47ce6
parent 7907 620ffec4c95f
child 7909 93db189773cd
Related to issue 38888: Failing SS Build
Solve NPE in build
src-test/org/openbravo/test/mobile/retail/multiserver/MultiserverUtils.java
--- a/src-test/org/openbravo/test/mobile/retail/multiserver/MultiserverUtils.java	Mon Nov 26 10:34:55 2018 +0100
+++ b/src-test/org/openbravo/test/mobile/retail/multiserver/MultiserverUtils.java	Mon Nov 26 12:12:34 2018 +0100
@@ -38,7 +38,8 @@
       .getPushPeriodMillis();
   private static final long routePeriodMillis = ConfigurationProperties.INSTANCE
       .getRoutePeriodMillis();
-  private static final long waitMillis = (long) ((pushPeriodMillis + routePeriodMillis) * 1.2);
+  private static final long waitMillis = Math.max(25000,
+      (long) ((pushPeriodMillis + routePeriodMillis) * 1.2));
 
   public static void waitForSynchronization() {
     waitForSynchronization(SequentialTestInfo.getServerType());
@@ -54,14 +55,18 @@
     // initial pause
     OBUtils.pause(2000);
     // wait for the store to sync
-    waitForOutgoingSynced(waitMillis / 10, 10, storeServerType, ServerType.CENTRAL);
+    waitForOutgoingSynced(waitMillis, 10, storeServerType, ServerType.CENTRAL);
     // wait for central to sync
-    waitForOutgoingSynced(waitMillis / 10, 10, ServerType.CENTRAL, storeServerType);
+    waitForOutgoingSynced(waitMillis, 10, ServerType.CENTRAL, storeServerType);
   }
 
   public static void waitForOutgoingSynced(final long interval, final int tries,
       final ServerType fromServerType, final ServerType toServerType) {
 
+    if (fromServerType == ServerType.UNKNOWN || fromServerType == ServerType.SINGLESERVER) {
+      return;
+    }
+
     String toServerKey = "Central";
     if (toServerType.equals(ServerType.STORE1)) {
       toServerKey = "Store1";