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


##########
pulsar-common/src/test/java/org/apache/pulsar/common/nar/NarUnpackerTest.java:
##########
@@ -118,6 +118,30 @@ public static void main(String[] args) {
         }
     }
 
+    @Test
+    void shouldReExtractWhenUnpackedDirectoryIsMissing() throws 
InterruptedException {
+        CountDownLatch countDownLatch = new CountDownLatch(1);
+        AtomicInteger exceptionCounter = new AtomicInteger();
+        AtomicInteger extractCounter = new AtomicInteger();
+
+        new Thread(() -> {
+            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();

Review Comment:
   Please clean up the remaining parts that were no longer needed. I added 
specific comments.



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