diff --git a/platform/util/testSrc/com/intellij/openapi/util/io/IoTestUtil.java b/platform/util/testSrc/com/intellij/openapi/util/io/IoTestUtil.java index 1e6e6deb03c8..ebc96ce401fd 100644 --- a/platform/util/testSrc/com/intellij/openapi/util/io/IoTestUtil.java +++ b/platform/util/testSrc/com/intellij/openapi/util/io/IoTestUtil.java @@ -208,7 +208,7 @@ public class IoTestUtil { private static int runCommand(final ProcessBuilder command) throws IOException, InterruptedException { command.redirectErrorStream(true); final Process process = command.start(); - new Thread(new Runnable() { + Thread thread = new Thread(new Runnable() { @Override public void run() { try { @@ -228,8 +228,11 @@ public class IoTestUtil { throw new RuntimeException(e); } } - },"io test").start(); - return process.waitFor(); + }, "io test"); + thread.start(); + int ret = process.waitFor(); + thread.join(); + return ret; } public static void assertTimestampsEqual(final long expected, final long actual) {