You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by je...@apache.org on 2018/08/01 14:05:19 UTC

[geode] branch develop updated: GEODE-5512: Do not test for OS process stats on Windows (#2238)

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

jensdeppe pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 6448cfa  GEODE-5512: Do not test for OS process stats on Windows (#2238)
6448cfa is described below

commit 6448cfa8fa3cdd38651a1e68556453ab2b73d74a
Author: Jens Deppe <jd...@pivotal.io>
AuthorDate: Wed Aug 1 07:05:14 2018 -0700

    GEODE-5512: Do not test for OS process stats on Windows (#2238)
---
 .../statistics/GemFireStatSamplerIntegrationTest.java   | 17 ++++++++++++-----
 .../geode/test/dunit/standalone/ProcessManager.java     |  6 ++++--
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/statistics/GemFireStatSamplerIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/statistics/GemFireStatSamplerIntegrationTest.java
index 250d99a..f7c0e6c 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/statistics/GemFireStatSamplerIntegrationTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/statistics/GemFireStatSamplerIntegrationTest.java
@@ -107,9 +107,6 @@ public class GemFireStatSamplerIntegrationTest extends StatSamplerTestCase {
    */
   @Test
   public void testBasics() throws Exception {
-    final String osName = System.getProperty("os.name", "unknown");
-    assumeFalse(osName.equals("Windows 7"));
-
     connect(createGemFireProperties());
 
     GemFireStatSampler statSampler = getGemFireStatSampler();
@@ -131,8 +128,6 @@ public class GemFireStatSamplerIntegrationTest extends StatSamplerTestCase {
     Assert.assertEquals(SocketCreator.getHostName(SocketCreator.getLocalHost()),
         statSampler.getSystemDirectoryPath());
 
-    AllStatistics allStats = new AllStatistics(statSampler);
-
     VMStatsContract vmStats = statSampler.getVMStats();
     assertNotNull(vmStats);
     assertTrue(vmStats instanceof VMStats50);
@@ -143,8 +138,20 @@ public class GemFireStatSamplerIntegrationTest extends StatSamplerTestCase {
 
     Method getProcessStats = getGemFireStatSampler().getClass().getMethod("getProcessStats");
     assertNotNull(getProcessStats);
+  }
+
+  @Test
+  public void testBasicProcessStats() throws Exception {
+    final String osName = System.getProperty("os.name", "unknown");
+    assumeFalse(osName.equals("Windows"));
+
+    connect(createGemFireProperties());
+    GemFireStatSampler statSampler = getGemFireStatSampler();
+    assertTrue(statSampler.waitForInitialization(5000));
 
     ProcessStats processStats = statSampler.getProcessStats();
+    AllStatistics allStats = new AllStatistics(statSampler);
+
     if (osName.equals("SunOS")) {
       assertNotNull(processStats);
       assertTrue(PureJavaMode.osStatsAreAvailable());
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/test/dunit/standalone/ProcessManager.java b/geode-core/src/integrationTest/java/org/apache/geode/test/dunit/standalone/ProcessManager.java
index 900fee0..fb7f2dd 100755
--- a/geode-core/src/integrationTest/java/org/apache/geode/test/dunit/standalone/ProcessManager.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/test/dunit/standalone/ProcessManager.java
@@ -67,8 +67,6 @@ public class ProcessManager {
       throw new IllegalStateException("VM " + vmNum + " is already running.");
     }
 
-    String[] cmd = buildJavaCommand(vmNum, namingPort, version);
-    System.out.println("Executing " + Arrays.toString(cmd));
     File workingDir = getVMDir(version, vmNum);
     if (!workingDir.exists()) {
       workingDir.mkdirs();
@@ -83,6 +81,10 @@ public class ProcessManager {
       }
       workingDir.mkdirs();
     }
+
+    String[] cmd = buildJavaCommand(vmNum, namingPort, version);
+    System.out.println("Executing " + Arrays.toString(cmd));
+
     if (log4jConfig != null) {
       FileUtils.copyFileToDirectory(log4jConfig, workingDir);
     }