YARN-9324. TestSchedulingRequestContainerAllocation(Async) fails with junit-4.11. Contributed by Prabhu Joseph.

This commit is contained in:
Weiwei Yang 2019-02-28 09:56:29 +08:00
parent cbf82fabf0
commit 1779fc57a1
2 changed files with 13 additions and 8 deletions

View File

@ -56,6 +56,7 @@ import org.junit.runners.Parameterized.Parameters;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -82,10 +83,11 @@ public class TestSchedulingRequestContainerAllocation {
@Parameters @Parameters
public static Object[] placementConstarintHandlers() { public static Collection<Object[]> placementConstarintHandlers() {
return new Object[] { Object[][] params = new Object[][] {
YarnConfiguration.PROCESSOR_RM_PLACEMENT_CONSTRAINTS_HANDLER, {YarnConfiguration.PROCESSOR_RM_PLACEMENT_CONSTRAINTS_HANDLER},
YarnConfiguration.SCHEDULER_RM_PLACEMENT_CONSTRAINTS_HANDLER}; {YarnConfiguration.SCHEDULER_RM_PLACEMENT_CONSTRAINTS_HANDLER} };
return Arrays.asList(params);
} }
public TestSchedulingRequestContainerAllocation( public TestSchedulingRequestContainerAllocation(

View File

@ -40,6 +40,8 @@ import org.junit.runner.RunWith;
import org.junit.runners.Parameterized; import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters; import org.junit.runners.Parameterized.Parameters;
import java.util.Arrays;
import java.util.Collection;
import java.util.List; import java.util.List;
/** /**
@ -55,10 +57,11 @@ public class TestSchedulingRequestContainerAllocationAsync {
RMNodeLabelsManager mgr; RMNodeLabelsManager mgr;
@Parameters @Parameters
public static Object[] placementConstarintHandlers() { public static Collection<Object[]> placementConstarintHandlers() {
return new Object[] { Object[][] params = new Object[][] {
YarnConfiguration.PROCESSOR_RM_PLACEMENT_CONSTRAINTS_HANDLER, {YarnConfiguration.PROCESSOR_RM_PLACEMENT_CONSTRAINTS_HANDLER},
YarnConfiguration.SCHEDULER_RM_PLACEMENT_CONSTRAINTS_HANDLER}; {YarnConfiguration.SCHEDULER_RM_PLACEMENT_CONSTRAINTS_HANDLER} };
return Arrays.asList(params);
} }
public TestSchedulingRequestContainerAllocationAsync( public TestSchedulingRequestContainerAllocationAsync(