hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zjs...@apache.org
Subject git commit: YARN-2785. Fixed intermittent TestContainerResourceUsage failure. Contributed by Varun Vasudev.
Date Sun, 02 Nov 2014 23:24:42 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.6 5a0aac550 -> 3e4182863


YARN-2785. Fixed intermittent TestContainerResourceUsage failure. Contributed by Varun Vasudev.

(cherry picked from commit 27715ec63bd77f1d31ee922b7daba85071da54ca)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/3e418286
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/3e418286
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/3e418286

Branch: refs/heads/branch-2.6
Commit: 3e4182863905d2f7e575b5a47c69a8d121215e45
Parents: 5a0aac5
Author: Zhijie Shen <zjshen@apache.org>
Authored: Sun Nov 2 15:20:40 2014 -0800
Committer: Zhijie Shen <zjshen@apache.org>
Committed: Sun Nov 2 15:24:07 2014 -0800

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                 |  3 +++
 .../TestContainerResourceUsage.java             | 21 +++++++++++++++-----
 2 files changed, 19 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/3e418286/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index e58e2d4..b84fc1e 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -761,6 +761,9 @@ Release 2.6.0 - UNRELEASED
     beyond HFDS delegation-token expiry even when RM is a proxy-user (YARN-2704).
     (Jian He via vinodkv)
 
+    YARN-2785. Fixed intermittent TestContainerResourceUsage failure. (Varun Vasudev
+    via zjshen)
+
 Release 2.5.1 - 2014-09-05
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/3e418286/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestContainerResourceUsage.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestContainerResourceUsage.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestContainerResourceUsage.java
index e0221aa..c200df4 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestContainerResourceUsage.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestContainerResourceUsage.java
@@ -70,7 +70,7 @@ public class TestContainerResourceUsage {
   public void tearDown() {
   }
 
-  @Test (timeout = 60000)
+  @Test (timeout = 120000)
   public void testUsageWithOneAttemptAndOneContainer() throws Exception {
     MockRM rm = new MockRM(conf);
     rm.start();
@@ -102,7 +102,12 @@ public class TestContainerResourceUsage {
            .getRMContainer(attempt0.getMasterContainer().getId());
 
     // Allow metrics to accumulate.
-    Thread.sleep(1000);
+    int sleepInterval = 1000;
+    int cumulativeSleepTime = 0;
+    while (rmAppMetrics.getMemorySeconds() <= 0 && cumulativeSleepTime < 5000)
{
+      Thread.sleep(sleepInterval);
+      cumulativeSleepTime += sleepInterval;
+    }
 
     rmAppMetrics = app0.getRMAppMetrics();
     Assert.assertTrue(
@@ -127,7 +132,7 @@ public class TestContainerResourceUsage {
     rm.stop();
   }
 
-  @Test (timeout = 60000)
+  @Test (timeout = 120000)
   public void testUsageWithMultipleContainersAndRMRestart() throws Exception {
     // Set max attempts to 1 so that when the first attempt fails, the app
     // won't try to start a new one.
@@ -180,8 +185,14 @@ public class TestContainerResourceUsage {
             .getSchedulerAppInfo(attempt0.getAppAttemptId())
               .getLiveContainers();
 
-    // Give the metrics time to accumulate.
-    Thread.sleep(1000);
+    // Allow metrics to accumulate.
+    int sleepInterval = 1000;
+    int cumulativeSleepTime = 0;
+    while (app0.getRMAppMetrics().getMemorySeconds() <= 0
+        && cumulativeSleepTime < 5000) {
+      Thread.sleep(sleepInterval);
+      cumulativeSleepTime += sleepInterval;
+    }
 
     // Stop all non-AM containers
     for (Container c : conts) {


Mime
View raw message