Skip to content

Commit 788b301

Browse files
committed
Make sure limitedThreads <= partest.threads
1 parent fb7168b commit 788b301

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

compiler/test/dotty/partest/DPConsoleRunner.scala

Lines changed: 9 additions & 2 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+
limitedThreads <= savedThreads,
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)

0 commit comments

Comments
 (0)