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

thw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apex-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 646674b  APEXCORE-800 Disable the disk health checker service for 
StramMiniClusterTest
646674b is described below

commit 646674ba9810b60d6e51950f6d12eb8bd5b0894a
Author: Vlad Rozov <vro...@apache.org>
AuthorDate: Thu Nov 30 11:19:43 2017 -0800

    APEXCORE-800 Disable the disk health checker service for 
StramMiniClusterTest
---
 .../datatorrent/stram/StramMiniClusterTest.java    | 23 ++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git 
a/engine/src/test/java/com/datatorrent/stram/StramMiniClusterTest.java 
b/engine/src/test/java/com/datatorrent/stram/StramMiniClusterTest.java
index 0e3c0ab..bbb7c1c 100644
--- a/engine/src/test/java/com/datatorrent/stram/StramMiniClusterTest.java
+++ b/engine/src/test/java/com/datatorrent/stram/StramMiniClusterTest.java
@@ -63,6 +63,7 @@ import org.apache.hadoop.yarn.api.records.ResourceRequest;
 import org.apache.hadoop.yarn.client.api.AMRMClient;
 import org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
+import org.apache.hadoop.yarn.exceptions.YarnException;
 import org.apache.hadoop.yarn.server.MiniYARNCluster;
 import org.apache.hadoop.yarn.server.resourcemanager.ClientRMService;
 import org.apache.hadoop.yarn.util.Records;
@@ -90,6 +91,7 @@ import com.datatorrent.stram.webapp.StramWebServices;
 
 import static java.lang.Thread.sleep;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
 /**
  * The purpose of this test is to verify basic streaming application deployment
@@ -126,6 +128,7 @@ public class StramMiniClusterTest
     conf.setInt("yarn.nodemanager.vmem-pmem-ratio", 20); // workaround to 
avoid containers being killed because java allocated too much vmem
     conf.set("yarn.scheduler.capacity.root.queues", "default");
     conf.set("yarn.scheduler.capacity.root.default.capacity", "100");
+    conf.setBoolean(YarnConfiguration.NM_DISK_HEALTH_CHECK_ENABLE, false);
     conf.set(YarnConfiguration.NM_ADMIN_USER_ENV, 
String.format("JAVA_HOME=%s,CLASSPATH=%s", System.getProperty("java.home"), 
getTestRuntimeClasspath()));
     conf.set(YarnConfiguration.NM_ENV_WHITELIST, 
YarnConfiguration.DEFAULT_NM_ENV_WHITELIST.replaceAll("JAVA_HOME,*", ""));
 
@@ -165,22 +168,26 @@ public class StramMiniClusterTest
     }
   }
 
-  @Test
-  public void testSetupShutdown() throws Exception
+  private void checkNodeState() throws YarnException
   {
-    GetClusterNodesRequest request =
-        Records.newRecord(GetClusterNodesRequest.class);
+    GetClusterNodesRequest request = 
Records.newRecord(GetClusterNodesRequest.class);
     ClientRMService clientRMService = 
yarnCluster.getResourceManager().getClientRMService();
     GetClusterNodesResponse response = 
clientRMService.getClusterNodes(request);
     List<NodeReport> nodeReports = response.getNodeReports();
     LOG.info("{}", nodeReports);
 
     for (NodeReport nr: nodeReports) {
-      LOG.info("Node: {}", nr.getNodeId());
-      LOG.info("Total memory: {}", nr.getCapability());
-      LOG.info("Used memory: {}", nr.getUsed());
-      LOG.info("Number containers: {}", nr.getNumContainers());
+      if (!nr.getNodeState().isUnusable()) {
+        return;
+      }
     }
+    fail("Yarn Mini cluster should have at least one usable node.");
+  }
+
+  @Test
+  public void testSetupShutdown() throws Exception
+  {
+    checkNodeState();
 
     JarHelper jarHelper = new JarHelper();
     LOG.info("engine jar: {}", jarHelper.getJar(StreamingAppMaster.class));

-- 
To stop receiving notification emails like this one, please contact
['"commits@apex.apache.org" <commits@apex.apache.org>'].

Reply via email to