lhotari commented on code in PR #23274:
URL: https://github.com/apache/pulsar/pull/23274#discussion_r1756448907


##########
pulsar-common/src/test/java/org/apache/pulsar/common/nar/NarUnpackerTest.java:
##########
@@ -118,6 +118,28 @@ public static void main(String[] args) {
         }
     }
 
+    @Test
+    void shouldReExtractWhenUnpackedDirectoryIsMissing() throws 
InterruptedException {
+        CountDownLatch countDownLatch = new CountDownLatch(1);
+        AtomicInteger exceptionCounter = new AtomicInteger();

Review Comment:
   these could be removed since there aren't threads running in the background



##########
pulsar-common/src/test/java/org/apache/pulsar/common/nar/NarUnpackerTest.java:
##########
@@ -118,6 +118,28 @@ public static void main(String[] args) {
         }
     }
 
+    @Test
+    void shouldReExtractWhenUnpackedDirectoryIsMissing() throws 
InterruptedException {
+        CountDownLatch countDownLatch = new CountDownLatch(1);
+        AtomicInteger exceptionCounter = new AtomicInteger();
+        AtomicInteger extractCounter = new AtomicInteger();
+
+        try {
+            File narWorkingDirectory = NarUnpacker.doUnpackNar(sampleZipFile, 
extractDirectory, extractCounter::incrementAndGet);
+            FileUtils.deleteFile(narWorkingDirectory, true);
+            NarUnpacker.doUnpackNar(sampleZipFile, extractDirectory, 
extractCounter::incrementAndGet);
+        } catch (Exception e) {
+            log.error("Unpacking failed", e);
+            exceptionCounter.incrementAndGet();
+        } finally {
+            countDownLatch.countDown();
+        }

Review Comment:
   remove this. there's no need to catch the exception since this isn't running 
in a background thread. if an exception is thrown, the test will fail.



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

Reply via email to