@@ -12,7 +12,7 @@ import java.nio.file.{Files, NoSuchFileException, Path, Paths}
1212import java .nio .charset .{Charset , StandardCharsets }
1313import java .text .SimpleDateFormat
1414import java .util .{HashMap , Timer , TimerTask }
15- import java .util .concurrent .{ExecutionException , TimeUnit , TimeoutException , Executors => JExecutors }
15+ import java .util .concurrent .{TimeUnit , TimeoutException , Executors => JExecutors }
1616
1717import scala .collection .mutable
1818import scala .io .{Codec , Source }
@@ -526,12 +526,6 @@ trait ParallelTesting extends RunnerOrchestration { self =>
526526 .and(" -d" , targetDir.getPath)
527527 .withClasspath(targetDir.getPath)
528528
529- def waitForJudiciously (process : Process ): Int =
530- try process.waitFor()
531- catch case _ : InterruptedException =>
532- try if process.waitFor(5L , TimeUnit .MINUTES ) then process.exitValue() else - 2
533- finally Thread .currentThread.interrupt()
534-
535529 def compileWithJavac (fs : Array [String ]) = if (fs.nonEmpty) {
536530 val fullArgs = Array (
537531 " -encoding" , StandardCharsets .UTF_8 .name,
@@ -540,7 +534,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
540534 val process = Runtime .getRuntime.exec(" javac" +: fullArgs)
541535 val output = Source .fromInputStream(process.getErrorStream).mkString
542536
543- if waitForJudiciously( process) != 0 then Some (output)
537+ if process.waitFor( ) != 0 then Some (output)
544538 else None
545539 } else None
546540
@@ -775,11 +769,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
775769
776770 for fut <- eventualResults do
777771 try fut.get()
778- catch
779- case ee : ExecutionException if ee.getCause.isInstanceOf [InterruptedException ] =>
780- System .err.println(" Interrupted (probably running after shutdown)" )
781- ee.printStackTrace()
782- case ex : Exception =>
772+ catch case ex : Exception =>
783773 System .err.println(ex.getMessage)
784774 ex.printStackTrace()
785775
0 commit comments