@@ -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 }
@@ -526,12 +526,6 @@ trait ParallelTesting extends RunnerOrchestration { self =>
526
526
.and(" -d" , targetDir.getPath)
527
527
.withClasspath(targetDir.getPath)
528
528
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
-
535
529
def compileWithJavac (fs : Array [String ]) = if (fs.nonEmpty) {
536
530
val fullArgs = Array (
537
531
" -encoding" , StandardCharsets .UTF_8 .name,
@@ -540,7 +534,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
540
534
val process = Runtime .getRuntime.exec(" javac" +: fullArgs)
541
535
val output = Source .fromInputStream(process.getErrorStream).mkString
542
536
543
- if waitForJudiciously( process) != 0 then Some (output)
537
+ if process.waitFor( ) != 0 then Some (output)
544
538
else None
545
539
} else None
546
540
@@ -775,11 +769,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
775
769
776
770
for fut <- eventualResults do
777
771
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 =>
783
773
System .err.println(ex.getMessage)
784
774
ex.printStackTrace()
785
775
0 commit comments