From dab22e74a4258ab9f0e0b4971971ece9043ca827 Mon Sep 17 00:00:00 2001 From: Weiwei Yang Date: Sun, 24 Feb 2019 22:42:27 +0800 Subject: [PATCH] YARN-9316. TestPlacementConstraintsUtil#testInterAppConstraintsByAppID fails intermittently. Contributed by Prabhu Joseph. (cherry picked from commit 9cd5c5447f008b38be43b21ca596d8a36ad0cd55) --- .../scheduler/constraint/TestPlacementConstraintsUtil.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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/constraint/TestPlacementConstraintsUtil.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/constraint/TestPlacementConstraintsUtil.java index 5dbdc8a1b94..2aa9971b675 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/constraint/TestPlacementConstraintsUtil.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/constraint/TestPlacementConstraintsUtil.java @@ -874,6 +874,8 @@ public class TestPlacementConstraintsUtil { long ts = System.currentTimeMillis(); ApplicationId application1 = BuilderUtils.newApplicationId(ts, 123); + ApplicationId application2 = BuilderUtils.newApplicationId(ts, 124); + ApplicationId application3 = BuilderUtils.newApplicationId(ts, 125); // Register App1 with anti-affinity constraint map. RMNode n0r1 = rmNodes.get(0); @@ -917,8 +919,6 @@ public class TestPlacementConstraintsUtil { srcTags2.add("app2"); constraintMap.put(srcTags2, constraint2); - ts = System.currentTimeMillis(); - ApplicationId application2 = BuilderUtils.newApplicationId(ts, 124); pcm.registerApplication(application2, constraintMap); // Anti-affinity with app1/hbase-m so it should not be able to be placed @@ -947,10 +947,7 @@ public class TestPlacementConstraintsUtil { srcTags3.add("app3"); constraintMap.put(srcTags3, constraint3); - ts = System.currentTimeMillis(); - ApplicationId application3 = BuilderUtils.newApplicationId(ts, 124); pcm.registerApplication(application3, constraintMap); - /** * Place container: * n0: app1/hbase-m(1), app3/hbase-m