myskov commented on code in PR #8349:
URL: https://github.com/apache/ozone/pull/8349#discussion_r2115666994
##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/TestSCMContainerPlacementRackAware.java:
##########
@@ -874,4 +874,19 @@ public void
chooseNodeWithUsedAndFavouredNodesMultipleRack()
assertEquals(favouredNodes.get(0), datanodeDetails.get(0));
}
+
+ @Test
+ public void testSourceDatanodeIsNotChosenAsTarget() {
+ setup(2);
+ List<DatanodeDetails> usedNodes = new ArrayList<>();
+ usedNodes.add(datanodes.get(0));
+ dnInfos.get(1).setNodeStatus(NodeStatus.inServiceHealthyReadOnly());
+
+ Exception e =
+ assertThrows(SCMException.class,
+ () -> policy.chooseDatanodes(usedNodes, null, null, 1, 0, 0),
+ "No target datanode, this call should fail");
+
+ assertEquals("SCMException", e.getClass().getSimpleName());
Review Comment:
this assert is no longer needed, as this is now verified by assertThrows
--
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]