fapifta commented on a change in pull request #2911:
URL: https://github.com/apache/ozone/pull/2911#discussion_r767309825



##########
File path: 
hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/TestOzoneECClient.java
##########
@@ -450,14 +456,28 @@ public void testNodeFailuresWhileWriting(int 
numFailureToInject,
         out.write(inputChunks[i]);
       }
 
-      List<DatanodeDetails> failedDNs = new ArrayList<>();
       Map<DatanodeDetails, MockDatanodeStorage> storages =
           ((MockXceiverClientFactory) factoryStub).getStorages();
-      DatanodeDetails[] dnDetails =
-          storages.keySet().toArray(new DatanodeDetails[storages.size()]);
-      for (int i = 0; i < numFailureToInject; i++) {
-        failedDNs.add(dnDetails[i]);
-      }
+      List<DatanodeDetails> failedDNs =

Review comment:
       Do we want to maintain the ordering? :)
   With the randomness here, I believe we gain that there are test runs that 
tests parity failures, and there are test runs that tests data failures. Flaky 
results still might be a problem, I think it is more tedious to test all 
possible scenarios, that is why I chose this way of fixing it.
   Though I think it is still not optimal, as it relies on the internal 
representation where we store the index of the DN in the most significant bits 
of the uuid of the DataNode, so I am open to any better idea, but if we order 
the nodes, and always select the first n to fail in this method, that might 
hide some of the possible issues that we can uncover easier with a proper 
random selection.




-- 
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]

Reply via email to