You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/08/28 15:04:51 UTC

[GitHub] [ozone] kerneltime commented on a change in pull request #2591: HDDS-5690. Speed up TestContainerReplication by removing testSkipDemmissionAndMaintenanceNode

kerneltime commented on a change in pull request #2591:
URL: https://github.com/apache/ozone/pull/2591#discussion_r697880904



##########
File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/TestSCMContainerPlacementRackAware.java
##########
@@ -524,4 +527,28 @@ public void testvalidateContainerPlacementSingleRackCluster() {
     assertTrue(stat.isPolicySatisfied());
     assertEquals(0, stat.misReplicationCount());
   }
+
+  @Test
+  public void testOutOfServiceNodesNotSelected() {
+    // Set all the nodes to out of service
+    for (DatanodeInfo dn : dnInfos) {
+      dn.setNodeStatus(new NodeStatus(DECOMMISSIONED, HEALTHY));
+    }
+
+    for (int i=0; i<10; i++) {
+      // Set a random DN to in_service and ensure it is always picked
+      int index = new Random().nextInt(dnInfos.size());
+      dnInfos.get(index).setNodeStatus(NodeStatus.inServiceHealthy());
+      try {
+        List<DatanodeDetails> datanodeDetails =
+            policy.chooseDatanodes(null, null, 1, 0, 0);
+        Assert.assertEquals(dnInfos.get(index), datanodeDetails.get(0));
+      } catch (SCMException e) {
+        // If we get SCMException: No satisfied datanode to meet the ... this is

Review comment:
       Should we add a check at the end to make sure that `policy.chooseDatanodes` worked at least once?




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org