Browse Source

Fix windows packaging tests (#47554)

On windows, it happens that the process we called terminates but some
other process it creates still has the same output strems and thus the
files open, so we can't clean it up.

This PR makes the cleanup a best effort.
Alpar Torok 6 years ago
parent
commit
2b0b0929fd
1 changed files with 6 additions and 2 deletions
  1. 6 2
      qa/os/src/test/java/org/elasticsearch/packaging/util/Shell.java

+ 6 - 2
qa/os/src/test/java/org/elasticsearch/packaging/util/Shell.java

@@ -170,8 +170,12 @@ public class Shell {
             Thread.currentThread().interrupt();
             throw new RuntimeException(e);
         } finally {
-           FileUtils.deleteIfExists(stdOut);
-           FileUtils.deleteIfExists(stdErr);
+            try {
+                FileUtils.deleteIfExists(stdOut);
+                FileUtils.deleteIfExists(stdErr);
+            } catch (UncheckedIOException e) {
+                logger.info("Cleanup of output files failed", e);
+            }
         }
     }