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.
This commit is contained in:
Alpar Torok 2019-10-04 14:02:24 +03:00
parent 31a5e1c7ee
commit 65c473bd4b

View File

@ -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);
}
}
}