hadoop-yarn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeag...@apache.org
Subject svn commit: r1407610 - in /hadoop/common/branches/branch-0.23/hadoop-yarn-project: CHANGES.txt hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestApplicationCleanup.java
Date Fri, 09 Nov 2012 19:59:12 GMT
Author: jeagles
Date: Fri Nov  9 19:59:12 2012
New Revision: 1407610

URL: http://svn.apache.org/viewvc?rev=1407610&view=rev
Log:
YARN-206. TestApplicationCleanup.testContainerCleanup occasionally fails. (jlowe via jeagles)

Modified:
    hadoop/common/branches/branch-0.23/hadoop-yarn-project/CHANGES.txt
    hadoop/common/branches/branch-0.23/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestApplicationCleanup.java

Modified: hadoop/common/branches/branch-0.23/hadoop-yarn-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-yarn-project/CHANGES.txt?rev=1407610&r1=1407609&r2=1407610&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-yarn-project/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.23/hadoop-yarn-project/CHANGES.txt Fri Nov  9 19:59:12
2012
@@ -77,6 +77,9 @@ Release 0.23.5 - UNRELEASED
     YARN-201. Fix CapacityScheduler to be less conservative for starved 
     off-switch requests. (jlowe via acmurthy) 
 
+    YARN-206. TestApplicationCleanup.testContainerCleanup occasionally fails.
+    (jlowe via jeagles)
+
 Release 0.23.4 - UNRELEASED
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-0.23/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestApplicationCleanup.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestApplicationCleanup.java?rev=1407610&r1=1407609&r2=1407610&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestApplicationCleanup.java
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestApplicationCleanup.java
Fri Nov  9 19:59:12 2012
@@ -81,33 +81,31 @@ public class TestApplicationCleanup {
         new ArrayList<ContainerId>()).getAllocatedContainers();
     int contReceived = conts.size();
     int waitCount = 0;
-    while (contReceived < request && waitCount++ < 20) {
+    while (contReceived < request && waitCount++ < 200) {
+      LOG.info("Got " + contReceived + " containers. Waiting to get "
+               + request);
+      Thread.sleep(100);
       conts = am.allocate(new ArrayList<ResourceRequest>(),
           new ArrayList<ContainerId>()).getAllocatedContainers();
       contReceived += conts.size();
-      LOG.info("Got " + contReceived + " containers. Waiting to get "
-               + request);
-      Thread.sleep(2000);
     }
-    Assert.assertEquals(request, conts.size());
+    Assert.assertEquals(request, contReceived);
     
     am.unregisterAppAttempt();
     am.waitForState(RMAppAttemptState.FINISHED);
 
-    int cleanedConts = 0;
-    int cleanedApps = 0;
-    List<ContainerId> contsToClean = null;
-    List<ApplicationId> apps = null;
-    
     //currently only containers are cleaned via this
     //AM container is cleaned via container launcher
+    resp = nm1.nodeHeartbeat(true);
+    List<ContainerId> contsToClean = resp.getContainersToCleanupList();
+    List<ApplicationId> apps = resp.getApplicationsToCleanupList();
+    int cleanedConts = contsToClean.size();
+    int cleanedApps = apps.size();
     waitCount = 0;
     while ((cleanedConts < 3 || cleanedApps < 1) && waitCount++ < 20) {
       HeartbeatResponse resp = nm1.nodeHeartbeat(true);
       contsToClean = resp.getContainersToCleanupList();
       apps = resp.getApplicationsToCleanupList();
-      LOG.info("Waiting to get cleanup events.. cleanedConts: "
-          + cleanedConts + " cleanedApps: " + cleanedApps);
       cleanedConts += contsToClean.size();
       cleanedApps += apps.size();
       Thread.sleep(1000);
@@ -168,20 +166,20 @@ public class TestApplicationCleanup {
         new ArrayList<ContainerId>()).getAllocatedContainers();
     int contReceived = conts.size();
     int waitCount = 0;
-    while (contReceived < request && waitCount++ < 20) {
+    while (contReceived < request && waitCount++ < 200) {
+      LOG.info("Got " + contReceived + " containers. Waiting to get "
+               + request);
+      Thread.sleep(100);
       conts = am.allocate(new ArrayList<ResourceRequest>(),
           new ArrayList<ContainerId>()).getAllocatedContainers();
       dispatcher.await();
       contReceived += conts.size();
-      LOG.info("Got " + contReceived + " containers. Waiting to get "
-               + request);
-      Thread.sleep(2000);
     }
-    Assert.assertEquals(request, conts.size());
+    Assert.assertEquals(request, contReceived);
 
     // Release a container.
     ArrayList<ContainerId> release = new ArrayList<ContainerId>();
-    release.add(conts.get(1).getId());
+    release.add(conts.get(0).getId());
     am.allocate(new ArrayList<ResourceRequest>(), release);
     dispatcher.await();
 
@@ -192,7 +190,7 @@ public class TestApplicationCleanup {
         new HashMap<ApplicationId, List<ContainerStatus>>();
     ArrayList<ContainerStatus> containerStatusList =
         new ArrayList<ContainerStatus>();
-    containerStatusList.add(BuilderUtils.newContainerStatus(conts.get(1)
+    containerStatusList.add(BuilderUtils.newContainerStatus(conts.get(0)
       .getId(), ContainerState.RUNNING, "nothing", 0));
     containerStatuses.put(app.getApplicationId(), containerStatusList);
 
@@ -201,13 +199,13 @@ public class TestApplicationCleanup {
     List<ContainerId> contsToClean = resp.getContainersToCleanupList();
     int cleanedConts = contsToClean.size();
     waitCount = 0;
-    while (cleanedConts < 1 && waitCount++ < 20) {
+    while (cleanedConts < 1 && waitCount++ < 200) {
+      LOG.info("Waiting to get cleanup events.. cleanedConts: " + cleanedConts);
+      Thread.sleep(100);
       resp = nm1.nodeHeartbeat(true);
       dispatcher.await();
       contsToClean = resp.getContainersToCleanupList();
-      LOG.info("Waiting to get cleanup events.. cleanedConts: " + cleanedConts);
       cleanedConts += contsToClean.size();
-      Thread.sleep(1000);
     }
     LOG.info("Got cleanup for " + contsToClean.get(0));
     Assert.assertEquals(1, cleanedConts);
@@ -218,7 +216,7 @@ public class TestApplicationCleanup {
         + "NM getting cleanup");
     containerStatuses.clear();
     containerStatusList.clear();
-    containerStatusList.add(BuilderUtils.newContainerStatus(conts.get(1)
+    containerStatusList.add(BuilderUtils.newContainerStatus(conts.get(0)
       .getId(), ContainerState.RUNNING, "nothing", 0));
     containerStatuses.put(app.getApplicationId(), containerStatusList);
 
@@ -229,13 +227,13 @@ public class TestApplicationCleanup {
     // The cleanup list won't be instantaneous as it is given out by scheduler
     // and not RMNodeImpl.
     waitCount = 0;
-    while (cleanedConts < 1 && waitCount++ < 20) {
+    while (cleanedConts < 1 && waitCount++ < 200) {
+      LOG.info("Waiting to get cleanup events.. cleanedConts: " + cleanedConts);
+      Thread.sleep(100);
       resp = nm1.nodeHeartbeat(true);
       dispatcher.await();
       contsToClean = resp.getContainersToCleanupList();
-      LOG.info("Waiting to get cleanup events.. cleanedConts: " + cleanedConts);
       cleanedConts += contsToClean.size();
-      Thread.sleep(1000);
     }
     LOG.info("Got cleanup for " + contsToClean.get(0));
     Assert.assertEquals(1, cleanedConts);



Mime
View raw message