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

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


The following commit(s) were added to refs/heads/release/1.9.1 by this push:
     new 9c35290  GEODE-6764: Fix tests broken and flaky on Windows (#3577)
9c35290 is described below

commit 9c35290e85a1c096dbdc3253eae125bce21a7fd7
Author: Jens Deppe <[email protected]>
AuthorDate: Fri May 10 15:03:33 2019 -0700

    GEODE-6764: Fix tests broken and flaky on Windows (#3577)
    
    
    - ExportConfigCommandTest was broken by refactorings around removing
      LegacyCommandResult.
    - AvailablePortHelperIntegrationTest has always been flaky on Windows.
      By default, Windows uses a bunch more ports than Linux, so some of
      these tests just don't work reliably as larger port ranges are not
      open and available on Windows.
---
 .../geode/internal/AvailablePortHelperIntegrationTest.java     | 10 ++++++++++
 .../internal/cli/commands/ExportConfigCommandTest.java         |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git 
a/geode-core/src/integrationTest/java/org/apache/geode/internal/AvailablePortHelperIntegrationTest.java
 
b/geode-core/src/integrationTest/java/org/apache/geode/internal/AvailablePortHelperIntegrationTest.java
index 0d68ae6..b75c7e3 100644
--- 
a/geode-core/src/integrationTest/java/org/apache/geode/internal/AvailablePortHelperIntegrationTest.java
+++ 
b/geode-core/src/integrationTest/java/org/apache/geode/internal/AvailablePortHelperIntegrationTest.java
@@ -24,6 +24,7 @@ import static 
org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTC
 import static 
org.apache.geode.internal.AvailablePortHelper.getRandomAvailableUDPPort;
 import static 
org.apache.geode.internal.AvailablePortHelper.initializeUniquePortRange;
 import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assume.assumeFalse;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
@@ -42,6 +43,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import org.apache.geode.internal.AvailablePort.Keeper;
+import org.apache.geode.internal.lang.SystemUtils;
 
 @RunWith(JUnitParamsRunner.class)
 public class AvailablePortHelperIntegrationTest {
@@ -266,6 +268,10 @@ public class AvailablePortHelperIntegrationTest {
   @Parameters({"true", "false"})
   public void initializeUniquePortRange_willReturnSamePortsForSameRange(
       final boolean useMembershipPortRange) {
+    assumeFalse(
+        "Windows has ports scattered throughout the range that makes this test 
difficult to pass consistently",
+        SystemUtils.isWindows());
+
     for (int i = 0; i < 100; ++i) {
       initializeUniquePortRange(i);
       int[] testPorts = getRandomAvailableTCPPorts(3, useMembershipPortRange);
@@ -278,6 +284,10 @@ public class AvailablePortHelperIntegrationTest {
   @Parameters({"true", "false"})
   public void initializeUniquePortRange_willReturnUniquePortsForUniqueRanges(
       final boolean useMembershipPortRange) {
+    assumeFalse(
+        "Windows has ports scattered throughout the range that makes this test 
difficult to pass consistently",
+        SystemUtils.isWindows());
+
     Set<Integer> ports = new HashSet<>();
 
     for (int i = 0; i < 100; ++i) {
diff --git 
a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportConfigCommandTest.java
 
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportConfigCommandTest.java
index 419acd7..2922f5f 100644
--- 
a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportConfigCommandTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportConfigCommandTest.java
@@ -44,6 +44,6 @@ public class ExportConfigCommandTest {
   public void incorrectDirectoryShowsError() throws Exception {
     String wrongDir = temp.newFile().getAbsolutePath();
     gfsh.executeAndAssertThat(command, "export config --dir=" + 
wrongDir).statusIsError()
-        .containsOutput(wrongDir.replace("\\", "\\\\") + " is not a 
directory");
+        .containsOutput(wrongDir + " is not a directory");
   }
 }

Reply via email to