lirui-apache commented on a change in pull request #3790:
URL: https://github.com/apache/iceberg/pull/3790#discussion_r774471053



##########
File path: 
spark/v3.2/spark/src/test/java/org/apache/iceberg/spark/SparkTestBaseWithCatalog.java
##########
@@ -44,9 +45,7 @@ public static void createWarehouse() throws IOException {
 
   @AfterClass
   public static void dropWarehouse() {
-    if (warehouse != null && warehouse.exists()) {
-      warehouse.delete();
-    }
+    FileUtils.deleteQuietly(warehouse);

Review comment:
       Do you mean we should not suppress exceptions if the folder can't be 
deleted? Then I guess we can use `FileUtils::forceDelete`, which has the 
following in java doc:
   ```java
        * Deletes a file. If file is a directory, delete it and all 
sub-directories.
        * <p>
        * The difference between File.delete() and this method are:
        * <ul>
        * <li>A directory to be deleted does not have to be empty.</li>
        * <li>You get exceptions when a file or directory cannot be deleted.
        *      (java.io.File methods returns a boolean)</li>
        * </ul>
   ```
   The problem with the original solution is it can't delete this folder.




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



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

Reply via email to