hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject hadoop git commit: YARN-6747. TestFSAppStarvation.testPreemptionEnable fails intermittently. (Contributed by Miklos Szegedi)
Date Sun, 29 Oct 2017 23:48:29 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-3.0 6b4319cc5 -> d9f027adb


YARN-6747. TestFSAppStarvation.testPreemptionEnable fails intermittently. (Contributed by
Miklos Szegedi)

(cherry picked from commit d4811c8cfae02f42a7aae1f775e87b6726caa3c9)


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

Branch: refs/heads/branch-3.0
Commit: d9f027adbc1233ce47357caea13a6e738cddbbe1
Parents: 6b4319c
Author: Yufei Gu <yufei@apache.org>
Authored: Sun Oct 29 16:44:16 2017 -0700
Committer: Yufei Gu <yufei@apache.org>
Committed: Sun Oct 29 16:48:07 2017 -0700

----------------------------------------------------------------------
 .../scheduler/fair/TestFSAppStarvation.java           | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/d9f027ad/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSAppStarvation.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/scheduler/fair/TestFSAppStarvation.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSAppStarvation.java
index 0712b4c..9665f9a 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSAppStarvation.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSAppStarvation.java
@@ -62,6 +62,9 @@ public class TestFSAppStarvation extends FairSchedulerTestBase {
         ALLOC_FILE.getAbsolutePath());
     conf.setBoolean(FairSchedulerConfiguration.PREEMPTION, true);
     conf.setFloat(FairSchedulerConfiguration.PREEMPTION_THRESHOLD, 0f);
+    // This effectively disables the update thread since we call update
+    // explicitly on the main thread
+    conf.setLong(FairSchedulerConfiguration.UPDATE_INTERVAL_MS, Long.MAX_VALUE);
   }
 
   @After
@@ -124,16 +127,17 @@ public class TestFSAppStarvation extends FairSchedulerTestBase {
 
     // Wait for apps to be processed by MockPreemptionThread
     for (int i = 0; i < 6000; ++i) {
-      if(preemptionThread.totalAppsAdded() >
-          preemptionThread.uniqueAppsAdded()) {
+      if(preemptionThread.totalAppsAdded() >=
+          preemptionThread.uniqueAppsAdded() * 2) {
         break;
       }
       Thread.sleep(10);
     }
 
-    assertTrue("Each app is marked as starved exactly once",
-        preemptionThread.totalAppsAdded() >
-            preemptionThread.uniqueAppsAdded());
+    assertEquals("Each app should be marked as starved once" +
+            " at each scheduler update above",
+        preemptionThread.totalAppsAdded(),
+        preemptionThread.uniqueAppsAdded() * 2);
   }
 
   /*


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message