lfxy commented on code in PR #5143:
URL: https://github.com/apache/hadoop/pull/5143#discussion_r1033554982
##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestDatanodeManager.java:
##########
@@ -1040,28 +1054,28 @@ private void verifyPendingRecoveryTasks(
idx++;
}
- if (numECTasks > 0) {
+ if (numECTasksToBeErasureCoded > 0) {
assertTrue(cmds[idx] instanceof BlockECReconstructionCommand);
BlockECReconstructionCommand cmd =
(BlockECReconstructionCommand) cmds[idx];
- assertEquals(numECTasks, cmd.getECTasks().size());
+ assertEquals(numECTasksToBeErasureCoded, cmd.getECTasks().size());
}
Mockito.verify(nodeInfo).getReplicationCommand(numReplicationTasks);
- Mockito.verify(nodeInfo).getErasureCodeCommand(numECTasks);
+ Mockito.verify(nodeInfo).getErasureCodeCommand(numECTasksToBeErasureCoded);
}
@Test
public void testPendingRecoveryTasks() throws IOException {
// Tasks are slitted according to the ratio between queue lengths.
- verifyPendingRecoveryTasks(20, 20, 20, 30, 10, 10, false);
- verifyPendingRecoveryTasks(40, 10, 20, 30, 16, 4, false);
+ verifyPendingRecoveryTasks(20, 0, 20, 20, 30, 10, 0, 10, false);
+ verifyPendingRecoveryTasks(40, 0, 10, 20, 30, 16, 0, 4, false);
// Approximately load tasks if the ratio between queue length is large.
- verifyPendingRecoveryTasks(400, 1, 20, 30, 20, 1, false);
+ verifyPendingRecoveryTasks(400, 0, 1, 20, 30, 20, 0, 1, false);
// Tasks use dfs.namenode.replication.max-streams-hard-limit for
decommissioning node
- verifyPendingRecoveryTasks(30, 30, 20, 30, 15, 15, true);
+ verifyPendingRecoveryTasks(20, 10, 10, 20, 40, 10, 10, 5, true);
Review Comment:
I have update verifyPendingRecoveryTasks(), and this case would success now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]