@@ -12,7 +12,7 @@ import java.nio.file.{Files, NoSuchFileException, Path, Paths}
12
12
import java .nio .charset .{Charset , StandardCharsets }
13
13
import java .text .SimpleDateFormat
14
14
import java .util .{HashMap , Timer , TimerTask }
15
- import java .util .concurrent .{ExecutionException , TimeUnit , TimeoutException , Executors => JExecutors }
15
+ import java .util .concurrent .{TimeUnit , TimeoutException , Executors => JExecutors }
16
16
17
17
import scala .collection .mutable
18
18
import scala .io .{Codec , Source }
@@ -511,12 +511,6 @@ trait ParallelTesting extends RunnerOrchestration { self =>
511
511
.and(" -d" , targetDir.getPath)
512
512
.withClasspath(targetDir.getPath)
513
513
514
- def waitForJudiciously (process : Process ): Int =
515
- try process.waitFor()
516
- catch case _ : InterruptedException =>
517
- try if process.waitFor(5L , TimeUnit .MINUTES ) then process.exitValue() else - 2
518
- finally Thread .currentThread.interrupt()
519
-
520
514
def compileWithJavac (fs : Array [String ]) = if (fs.nonEmpty) {
521
515
val fullArgs = Array (
522
516
" -encoding" , StandardCharsets .UTF_8 .name,
@@ -525,7 +519,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
525
519
val process = Runtime .getRuntime.exec(" javac" +: fullArgs)
526
520
val output = Source .fromInputStream(process.getErrorStream).mkString
527
521
528
- if waitForJudiciously( process) != 0 then Some (output)
522
+ if process.waitFor( ) != 0 then Some (output)
529
523
else None
530
524
} else None
531
525
@@ -704,11 +698,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
704
698
705
699
for fut <- eventualResults do
706
700
try fut.get()
707
- catch
708
- case ee : ExecutionException if ee.getCause.isInstanceOf [InterruptedException ] =>
709
- System .err.println(" Interrupted (probably running after shutdown)" )
710
- ee.printStackTrace()
711
- case ex : Exception =>
701
+ catch case ex : Exception =>
712
702
System .err.println(ex.getMessage)
713
703
ex.printStackTrace()
714
704
0 commit comments