adoroszlai commented on a change in pull request #551: HDDS-2717. Handle chunk 
increments in datanode
URL: https://github.com/apache/hadoop-ozone/pull/551#discussion_r387791307
 
 

 ##########
 File path: 
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestBlockDeletingService.java
 ##########
 @@ -369,34 +352,27 @@ public void testContainerThrottle() throws Exception {
     // Process 1 container per interval
     conf.set(
         ScmConfigKeys.OZONE_SCM_KEY_VALUE_CONTAINER_DELETION_CHOOSING_POLICY,
-        RandomContainerDeletionChoosingPolicy.class.getName());
+        TopNOrderedContainerDeletionChoosingPolicy.class.getName());
     conf.setInt(OZONE_BLOCK_DELETING_CONTAINER_LIMIT_PER_INTERVAL, 1);
     conf.setInt(OZONE_BLOCK_DELETING_LIMIT_PER_CONTAINER, 1);
     ContainerSet containerSet = new ContainerSet();
-    createToDeleteBlocks(containerSet, conf, 2, 1, 10);
+    int containerCount = 2;
+    int chunksPerBlock = 10;
+    int blocksPerContainer = 1;
+    createToDeleteBlocks(containerSet, conf, containerCount, 
blocksPerContainer,
+        chunksPerBlock);
 
     BlockDeletingServiceTestImpl service =
-        getBlockDeletinService(containerSet, conf, 1000);
+        getBlockDeletingService(containerSet, conf);
     service.start();
 
     try {
       GenericTestUtils.waitFor(service::isStarted, 100, 3000);
-      // 1st interval processes 1 container 1 block and 10 chunks
-      deleteAndWait(service, 1);
-      Assert.assertEquals(10, getNumberOfChunksInContainers(containerSet));
-
-      AtomicInteger timesToProcess = new AtomicInteger(1);
-      GenericTestUtils.waitFor(() -> {
-        try {
-          timesToProcess.incrementAndGet();
-          deleteAndWait(service, timesToProcess.get());
-          if (getNumberOfChunksInContainers(containerSet) == 0) {
-            return true;
-          }
-        } catch (Exception ignored) {}
-        return false;
-      }, 100, 100000);
-      Assert.assertEquals(0, getNumberOfChunksInContainers(containerSet));
 
 Review comment:
   The problem with this test (and the service it tests) was that it used 
internal information about the layout.  Will check whether such information is 
still available without depending on filenames etc.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to