From 1779fc57a1183c3cc8ff51fe70fdd2892c44b4fe Mon Sep 17 00:00:00 2001 From: Weiwei Yang Date: Thu, 28 Feb 2019 09:56:29 +0800 Subject: [PATCH] YARN-9324. TestSchedulingRequestContainerAllocation(Async) fails with junit-4.11. Contributed by Prabhu Joseph. --- .../TestSchedulingRequestContainerAllocation.java | 10 ++++++---- ...TestSchedulingRequestContainerAllocationAsync.java | 11 +++++++---- 2 files changed, 13 insertions(+), 8 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/capacity/TestSchedulingRequestContainerAllocation.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestSchedulingRequestContainerAllocation.java index b1bb515d73..2c1476e4b6 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestSchedulingRequestContainerAllocation.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestSchedulingRequestContainerAllocation.java @@ -56,6 +56,7 @@ import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -82,10 +83,11 @@ public class TestSchedulingRequestContainerAllocation { @Parameters - public static Object[] placementConstarintHandlers() { - return new Object[] { - YarnConfiguration.PROCESSOR_RM_PLACEMENT_CONSTRAINTS_HANDLER, - YarnConfiguration.SCHEDULER_RM_PLACEMENT_CONSTRAINTS_HANDLER}; + public static Collection placementConstarintHandlers() { + Object[][] params = new Object[][] { + {YarnConfiguration.PROCESSOR_RM_PLACEMENT_CONSTRAINTS_HANDLER}, + {YarnConfiguration.SCHEDULER_RM_PLACEMENT_CONSTRAINTS_HANDLER} }; + return Arrays.asList(params); } public TestSchedulingRequestContainerAllocation( 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/capacity/TestSchedulingRequestContainerAllocationAsync.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestSchedulingRequestContainerAllocationAsync.java index 95e0a722e9..9ce03c993b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestSchedulingRequestContainerAllocationAsync.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestSchedulingRequestContainerAllocationAsync.java @@ -40,6 +40,8 @@ import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; +import java.util.Arrays; +import java.util.Collection; import java.util.List; /** @@ -55,10 +57,11 @@ public class TestSchedulingRequestContainerAllocationAsync { RMNodeLabelsManager mgr; @Parameters - public static Object[] placementConstarintHandlers() { - return new Object[] { - YarnConfiguration.PROCESSOR_RM_PLACEMENT_CONSTRAINTS_HANDLER, - YarnConfiguration.SCHEDULER_RM_PLACEMENT_CONSTRAINTS_HANDLER}; + public static Collection placementConstarintHandlers() { + Object[][] params = new Object[][] { + {YarnConfiguration.PROCESSOR_RM_PLACEMENT_CONSTRAINTS_HANDLER}, + {YarnConfiguration.SCHEDULER_RM_PLACEMENT_CONSTRAINTS_HANDLER} }; + return Arrays.asList(params); } public TestSchedulingRequestContainerAllocationAsync(