@@ -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 }
@@ -512,12 +512,6 @@ trait ParallelTesting extends RunnerOrchestration { self =>
512
512
.and(" -d" , targetDir.getPath)
513
513
.withClasspath(targetDir.getPath)
514
514
515
- def waitForJudiciously (process : Process ): Int =
516
- try process.waitFor()
517
- catch case _ : InterruptedException =>
518
- try if process.waitFor(5L , TimeUnit .MINUTES ) then process.exitValue() else - 2
519
- finally Thread .currentThread.interrupt()
520
-
521
515
def compileWithJavac (fs : Array [String ]) = if (fs.nonEmpty) {
522
516
val fullArgs = Array (
523
517
" -encoding" , StandardCharsets .UTF_8 .name,
@@ -526,7 +520,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
526
520
val process = Runtime .getRuntime.exec(" javac" +: fullArgs)
527
521
val output = Source .fromInputStream(process.getErrorStream).mkString
528
522
529
- if waitForJudiciously( process) != 0 then Some (output)
523
+ if process.waitFor( ) != 0 then Some (output)
530
524
else None
531
525
} else None
532
526
@@ -751,11 +745,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
751
745
752
746
for fut <- eventualResults do
753
747
try fut.get()
754
- catch
755
- case ee : ExecutionException if ee.getCause.isInstanceOf [InterruptedException ] =>
756
- System .err.println(" Interrupted (probably running after shutdown)" )
757
- ee.printStackTrace()
758
- case ex : Exception =>
748
+ catch case ex : Exception =>
759
749
System .err.println(ex.getMessage)
760
750
ex.printStackTrace()
761
751
0 commit comments