Skip to content

Commit 3366da3

Browse files
authored
Merge pull request #259 from scala/backport-lts-3.3-21801
Backport "Revert dubious retry in vulpix" to 3.3 LTS
2 parents fef7d1d + 32cb514 commit 3366da3

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

compiler/test/dotty/tools/vulpix/ParallelTesting.scala

+3-13
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import java.nio.file.{Files, NoSuchFileException, Path, Paths}
1212
import java.nio.charset.{Charset, StandardCharsets}
1313
import java.text.SimpleDateFormat
1414
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}
1616

1717
import scala.collection.mutable
1818
import scala.io.{Codec, Source}
@@ -511,12 +511,6 @@ trait ParallelTesting extends RunnerOrchestration { self =>
511511
.and("-d", targetDir.getPath)
512512
.withClasspath(targetDir.getPath)
513513

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-
520514
def compileWithJavac(fs: Array[String]) = if (fs.nonEmpty) {
521515
val fullArgs = Array(
522516
"-encoding", StandardCharsets.UTF_8.name,
@@ -525,7 +519,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
525519
val process = Runtime.getRuntime.exec("javac" +: fullArgs)
526520
val output = Source.fromInputStream(process.getErrorStream).mkString
527521

528-
if waitForJudiciously(process) != 0 then Some(output)
522+
if process.waitFor() != 0 then Some(output)
529523
else None
530524
} else None
531525

@@ -704,11 +698,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
704698

705699
for fut <- eventualResults do
706700
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 =>
712702
System.err.println(ex.getMessage)
713703
ex.printStackTrace()
714704

0 commit comments

Comments
 (0)