adoroszlai commented on a change in pull request #1551:
URL: https://github.com/apache/ozone/pull/1551#discussion_r526342097



##########
File path: 
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestSimpleContainerDownloader.java
##########
@@ -21,24 +21,84 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
 
+import org.apache.hadoop.hdds.conf.ConfigurationSource;
 import org.apache.hadoop.hdds.conf.OzoneConfiguration;
 import org.apache.hadoop.hdds.protocol.DatanodeDetails;
 import org.apache.hadoop.hdds.protocol.MockDatanodeDetails;
 
 import org.junit.Assert;
 import org.junit.Test;
 
-/**
- * Test container downloader.
+/*
+ * Test SimpleContainerDownloader.
  */
 public class TestSimpleContainerDownloader {
 
   private static final String SUCCESS_PATH = "downloaded";
 
+  @Test
+  public void testGetContainerDataFromReplicasHappyPath() throws Exception {
+
+    //GIVEN
+    List<DatanodeDetails> datanodes = createDatanodes();
+
+    SimpleContainerDownloader downloader =
+        createDownloaderWithPredefinedFailures(true);
+
+    //WHEN
+    final Path result =
+        downloader.getContainerDataFromReplicas(1L, datanodes)
+            .get(1L, TimeUnit.SECONDS);
+
+    //THEN
+    Assert.assertEquals(datanodes.get(0).getUuidString(), result.toString());

Review comment:
       Actually, these checks are no longer valid after 5e8aaee77 since 
`SimpleContainerDownloader` shuffles the datanodes.
   
   
https://github.com/apache/ozone/blob/0aca5c7058252a60db91ac06a5ded931e1e08296/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/SimpleContainerDownloader.java#L79-L84




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

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