This is an automated email from the ASF dual-hosted git repository.

onichols pushed a commit to branch support/1.12
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/support/1.12 by this push:
     new d8ab0ec  GEODE-8025: fix lucene test to not hang on support branches 
(#4999)
d8ab0ec is described below

commit d8ab0ecda9b0e870d4f1599c96da26ba8e79a702
Author: Owen Nichols <[email protected]>
AuthorDate: Sat Apr 25 20:39:31 2020 -0700

    GEODE-8025: fix lucene test to not hang on support branches (#4999)
    
    
    (cherry picked from commit fad52b8d8fa449633bc0c87619f6d2f43e0752f7)
---
 ...ouldBeSuccessfulWhenAllServersRollToCurrentVersion.java | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git 
a/geode-lucene/src/upgradeTest/java/org/apache/geode/cache/lucene/RollingUpgradeReindexShouldBeSuccessfulWhenAllServersRollToCurrentVersion.java
 
b/geode-lucene/src/upgradeTest/java/org/apache/geode/cache/lucene/RollingUpgradeReindexShouldBeSuccessfulWhenAllServersRollToCurrentVersion.java
index 39ace58..07aed81 100644
--- 
a/geode-lucene/src/upgradeTest/java/org/apache/geode/cache/lucene/RollingUpgradeReindexShouldBeSuccessfulWhenAllServersRollToCurrentVersion.java
+++ 
b/geode-lucene/src/upgradeTest/java/org/apache/geode/cache/lucene/RollingUpgradeReindexShouldBeSuccessfulWhenAllServersRollToCurrentVersion.java
@@ -18,11 +18,14 @@ import static 
org.apache.geode.test.awaitility.GeodeAwaitility.await;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import org.assertj.core.api.Assertions;
+import org.junit.Assume;
 import org.junit.Test;
 
 import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.distributed.internal.InternalLocator;
 import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.internal.serialization.Version;
 import org.apache.geode.test.dunit.AsyncInvocation;
 import org.apache.geode.test.dunit.DistributedTestUtils;
 import org.apache.geode.test.dunit.Host;
@@ -34,6 +37,9 @@ public class 
RollingUpgradeReindexShouldBeSuccessfulWhenAllServersRollToCurrentV
 
   @Test
   public void 
luceneReindexShouldBeSuccessfulWhenAllServersRollToCurrentVersion() throws 
Exception {
+    Assume.assumeFalse("minor versions should be different",
+        majorMinor(oldVersion).equals(majorMinor(Version.CURRENT.getName())));
+
     final Host host = Host.getHost(0);
     VM locator1 = host.getVM(oldVersion, 0);
     VM server1 = host.getVM(oldVersion, 1);
@@ -109,5 +115,13 @@ public class 
RollingUpgradeReindexShouldBeSuccessfulWhenAllServersRollToCurrentV
     }
   }
 
+  /**
+   * returns the major.minor prefix of a semver
+   */
+  private static String majorMinor(String version) {
+    String[] parts = version.split("\\.");
+    Assertions.assertThat(parts.length).isGreaterThanOrEqualTo(2);
+    return parts[0] + "." + parts[1];
+  }
 
 }

Reply via email to