Skip to content

Commit 65c473b

Browse files
committed
Fix windows packaging tests (elastic#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.
1 parent 31a5e1c commit 65c473b

File tree

1 file changed

+6
-2
lines changed
  • qa/os/src/test/java/org/elasticsearch/packaging/util

1 file changed

+6
-2
lines changed

qa/os/src/test/java/org/elasticsearch/packaging/util/Shell.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,12 @@ private Result runScriptIgnoreExitCode(String[] command) {
170170
Thread.currentThread().interrupt();
171171
throw new RuntimeException(e);
172172
} finally {
173-
FileUtils.deleteIfExists(stdOut);
174-
FileUtils.deleteIfExists(stdErr);
173+
try {
174+
FileUtils.deleteIfExists(stdOut);
175+
FileUtils.deleteIfExists(stdErr);
176+
} catch (UncheckedIOException e) {
177+
logger.info("Cleanup of output files failed", e);
178+
}
175179
}
176180
}
177181

0 commit comments

Comments
 (0)