Skip to content

Commit

Permalink
Revert dubious retry in vulpix (#21801)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamzaremmal authored Feb 21, 2025
2 parents 750da51 + 72bff19 commit b9cecd2
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions compiler/test/dotty/tools/vulpix/ParallelTesting.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import java.nio.file.{Files, NoSuchFileException, Path, Paths}
import java.nio.charset.{Charset, StandardCharsets}
import java.text.SimpleDateFormat
import java.util.{HashMap, Timer, TimerTask}
import java.util.concurrent.{ExecutionException, TimeUnit, TimeoutException, Executors => JExecutors}
import java.util.concurrent.{TimeUnit, TimeoutException, Executors => JExecutors}

import scala.collection.mutable
import scala.io.{Codec, Source}
Expand Down Expand Up @@ -526,12 +526,6 @@ trait ParallelTesting extends RunnerOrchestration { self =>
.and("-d", targetDir.getPath)
.withClasspath(targetDir.getPath)

def waitForJudiciously(process: Process): Int =
try process.waitFor()
catch case _: InterruptedException =>
try if process.waitFor(5L, TimeUnit.MINUTES) then process.exitValue() else -2
finally Thread.currentThread.interrupt()

def compileWithJavac(fs: Array[String]) = if (fs.nonEmpty) {
val fullArgs = Array(
"-encoding", StandardCharsets.UTF_8.name,
Expand All @@ -540,7 +534,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
val process = Runtime.getRuntime.exec("javac" +: fullArgs)
val output = Source.fromInputStream(process.getErrorStream).mkString

if waitForJudiciously(process) != 0 then Some(output)
if process.waitFor() != 0 then Some(output)
else None
} else None

Expand Down Expand Up @@ -775,11 +769,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>

for fut <- eventualResults do
try fut.get()
catch
case ee: ExecutionException if ee.getCause.isInstanceOf[InterruptedException] =>
System.err.println("Interrupted (probably running after shutdown)")
ee.printStackTrace()
case ex: Exception =>
catch case ex: Exception =>
System.err.println(ex.getMessage)
ex.printStackTrace()

Expand Down

0 comments on commit b9cecd2

Please sign in to comment.