You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/01/26 04:58:51 UTC

[GitHub] [dolphinscheduler] SbloodyS commented on a change in pull request #8197: Clean up the E2E with Java API to avoid platform sensitive

SbloodyS commented on a change in pull request #8197:
URL: https://github.com/apache/dolphinscheduler/pull/8197#discussion_r792313788



##########
File path: dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/FileManageE2ETest.java
##########
@@ -95,18 +98,14 @@ public static void setup() {
     }
 
     @AfterAll
+    @SneakyThrows
     public static void cleanup() {
-        String[] command = {"/bin/bash", "-c", String.format("sudo rm -f %s && sudo rm -f %s && sudo rm -rf %s", testUnder1GBFilePath, testOver1GBFilePath, Constants.HOST_CHROME_DOWNLOAD_PATH)};
-
-        try {
-            Process pro = Runtime.getRuntime().exec(command);
-            int status = pro.waitFor();
-            if (status != 0) {
-                throw new RuntimeException(String.format("Failed to call shell's command: %s", Arrays.toString(command)));
-            }
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
+        Files.deleteIfExists(testUnder1GBFilePath);
+        Files.deleteIfExists(testOver1GBFilePath);
+        Files.walk(Constants.HOST_CHROME_DOWNLOAD_PATH)

Review comment:
       I have a question. The folder deleted in this place is a folder created by root user. Why is there no permission exception? I tried this method before, but threw an exception with insufficient permission.




-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org