adoroszlai commented on a change in pull request #1146:
URL: https://github.com/apache/hadoop-ozone/pull/1146#discussion_r446823080



##########
File path: 
hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/utils/TestResourceLimitCache.java
##########
@@ -60,25 +58,27 @@ public void testResourceLimitCache()
     resourceCache.remove(4);
 
     GenericTestUtils.waitFor(future::isDone, 100, 1000);
-    // map has the ket 1
+    // map has the key 1
     Assert.assertTrue(future.isDone() && !future.isCompletedExceptionally());
     Assert.assertNotNull(resourceCache.get(1));
 
     // Create a future which blocks to put 4. Currently map has acquired 7
     // permits out of 10
+    ExecutorService pool = Executors.newCachedThreadPool();
     future = CompletableFuture.supplyAsync(() -> {
       try {
         return resourceCache.put(4, "a");
       } catch (InterruptedException e) {
-        e.printStackTrace();
+        return null;
       }
-      return null;
     });

Review comment:
       `pool` is currently unused, I think you intended to pass it to 
`supplyAsync`:
   
   ```suggestion
       }, pool);
   ```

##########
File path: 
hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/utils/TestResourceLimitCache.java
##########
@@ -20,9 +20,7 @@
 import org.junit.Assert;
 import org.junit.Test;
 
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.TimeoutException;
+import java.util.concurrent.*;

Review comment:
       Nit: please avoid `*` import.




----------------------------------------------------------------
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:
us...@infra.apache.org



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

Reply via email to