Skip to content

Commit 6700dbd

Browse files
committed
Make sure limitedThreads <= partest.threads
1 parent c429733 commit 6700dbd

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

compiler/test/dotty/partest/DPConsoleRunner.scala

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,16 @@ extends SuiteRunner(testSourcePath, fileManager, updateCheck, failed, javaCmdPat
114114
val seqResults =
115115
if (!limitResourceTests.isEmpty) {
116116
val savedThreads = sys.props("partest.threads")
117-
sys.props("partest.threads") = limitedThreads
117+
sys.props("partest.threads") = {
118+
assert(
119+
savedThreads == null || limitedThreads.toInt <= savedThreads.toInt,
120+
"""|Should not use more threads than the default, when the point
121+
|is to limit the amount of resources""".stripMargin
122+
)
123+
limitedThreads
124+
}
118125

119-
NestUI.echo(s"## we will run ${limitResourceTests.length} tests using ${PartestDefaults.numThreads} thread(s)")
126+
NestUI.echo(s"## we will run ${limitResourceTests.length} tests using ${PartestDefaults.numThreads} thread(s) in parallel")
120127
val res = super.runTestsForFiles(limitResourceTests, kind)
121128

122129
if (savedThreads != null)
@@ -392,13 +399,9 @@ class DPTestRunner(testFile: File, suiteRunner: DPSuiteRunner) extends nest.Runn
392399
suiteRunner.fileManager.asInstanceOf[DottyFileManager].extraJarList ::: super.extraClasspath
393400

394401
// override to keep class files if failed and delete clog if ok
395-
override def cleanup = if (lastState.isOk) try {
402+
override def cleanup = if (lastState.isOk) {
396403
logFile.delete
397404
cLogFile.delete
398405
Directory(outDir).deleteRecursively
399-
} catch {
400-
case t: Throwable =>
401-
println("whhhhhhhhhhhhhhhhhhhhhhhhhhhaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaat")
402-
throw t
403406
}
404407
}

0 commit comments

Comments
 (0)