Skip to content

Commit dc91299

Browse files
committed
YARN-8244. TestContainerSchedulerQueuing.testStartMultipleContainers failed. Contributed by Jim Brennan
1 parent ba12e88 commit dc91299

File tree

2 files changed

+42
-78
lines changed

2 files changed

+42
-78
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/TestContainerManager.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,8 +1486,6 @@ public void testMultipleContainersLaunch() throws Exception {
14861486
containerManager.start();
14871487

14881488
List<StartContainerRequest> list = new ArrayList<>();
1489-
ContainerLaunchContext containerLaunchContext =
1490-
recordFactory.newRecordInstance(ContainerLaunchContext.class);
14911489
for (int i = 0; i < 10; i++) {
14921490
ContainerId cId = createContainerId(i);
14931491
long identifier = 0;
@@ -1500,8 +1498,9 @@ public void testMultipleContainersLaunch() throws Exception {
15001498
createContainerToken(cId, identifier, context.getNodeId(), user,
15011499
context.getContainerTokenSecretManager());
15021500
StartContainerRequest request =
1503-
StartContainerRequest.newInstance(containerLaunchContext,
1504-
containerToken);
1501+
StartContainerRequest.newInstance(
1502+
recordFactory.newRecordInstance(ContainerLaunchContext.class),
1503+
containerToken);
15051504
list.add(request);
15061505
}
15071506
StartContainersRequest requestList =
@@ -1531,9 +1530,6 @@ public void testMultipleContainersLaunch() throws Exception {
15311530
public void testMultipleContainersStopAndGetStatus() throws Exception {
15321531
containerManager.start();
15331532
List<StartContainerRequest> startRequest = new ArrayList<>();
1534-
ContainerLaunchContext containerLaunchContext =
1535-
recordFactory.newRecordInstance(ContainerLaunchContext.class);
1536-
15371533
List<ContainerId> containerIds = new ArrayList<>();
15381534
for (int i = 0; i < 10; i++) {
15391535
ContainerId cId;
@@ -1547,8 +1543,9 @@ public void testMultipleContainersStopAndGetStatus() throws Exception {
15471543
createContainerToken(cId, DUMMY_RM_IDENTIFIER, context.getNodeId(),
15481544
user, context.getContainerTokenSecretManager());
15491545
StartContainerRequest request =
1550-
StartContainerRequest.newInstance(containerLaunchContext,
1551-
containerToken);
1546+
StartContainerRequest.newInstance(
1547+
recordFactory.newRecordInstance(ContainerLaunchContext.class),
1548+
containerToken);
15521549
startRequest.add(request);
15531550
containerIds.add(cId);
15541551
}
@@ -1788,15 +1785,14 @@ public void testIncreaseContainerResourceWithInvalidRequests() throws Exception
17881785
containerManager.start();
17891786
// Start 4 containers 0..4 with default resource (1024, 1)
17901787
List<StartContainerRequest> list = new ArrayList<>();
1791-
ContainerLaunchContext containerLaunchContext = recordFactory
1792-
.newRecordInstance(ContainerLaunchContext.class);
17931788
for (int i = 0; i < 4; i++) {
17941789
ContainerId cId = createContainerId(i);
17951790
long identifier = DUMMY_RM_IDENTIFIER;
17961791
Token containerToken = createContainerToken(cId, identifier,
17971792
context.getNodeId(), user, context.getContainerTokenSecretManager());
17981793
StartContainerRequest request = StartContainerRequest.newInstance(
1799-
containerLaunchContext, containerToken);
1794+
recordFactory.newRecordInstance(ContainerLaunchContext.class),
1795+
containerToken);
18001796
list.add(request);
18011797
}
18021798
StartContainersRequest requestList = StartContainersRequest

0 commit comments

Comments
 (0)