diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-11-23 16:01:53 +0100 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-11-23 18:08:54 +0100 |
commit | c429733272d9f8725e7769f63ebd9a86a403cd09 (patch) | |
tree | 90bc7ddb741317928945516d253a688df0232dc9 /compiler/test | |
parent | fa6054b874d1a9b6428d30f88a0346fc994c97de (diff) | |
download | dotty-c429733272d9f8725e7769f63ebd9a86a403cd09.tar.gz dotty-c429733272d9f8725e7769f63ebd9a86a403cd09.tar.bz2 dotty-c429733272d9f8725e7769f63ebd9a86a403cd09.zip |
Update sequential tasks portion
Diffstat (limited to 'compiler/test')
-rw-r--r-- | compiler/test/dotty/partest/DPConsoleRunner.scala | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/compiler/test/dotty/partest/DPConsoleRunner.scala b/compiler/test/dotty/partest/DPConsoleRunner.scala index 363012683..1e0be75d8 100644 --- a/compiler/test/dotty/partest/DPConsoleRunner.scala +++ b/compiler/test/dotty/partest/DPConsoleRunner.scala @@ -88,27 +88,36 @@ extends SuiteRunner(testSourcePath, fileManager, updateCheck, failed, javaCmdPat """.stripMargin } - /** Tests which are compiled with one or more of the flags in this list will be run - * one by one, without any other test running at the same time. - * This is necessary because some test flags require a lot of memory when running - * the compiler and may exhaust the available memory when run in parallel with other tests. - */ - def sequentialFlags = List("-Ytest-pickler") + /** Some tests require a limitation of resources, tests which are compiled + * with one or more of the flags in this list will be run with + * `limitedThreads`. This is necessary because some test flags require a lot + * of memory when running the compiler and may exhaust the available memory + * when run in parallel with too many other tests. + * + * This number could be increased on the CI, but might fail locally if + * scaled too extreme - override with: + * + * ``` + * -Ddotty.tests.limitedThreads=X + * ``` + */ + def limitResourceFlags = List("-Ytest-pickler") + private val limitedThreads = sys.props.get("dotty.tests.limitedThreads").getOrElse("2") override def runTestsForFiles(kindFiles: Array[File], kind: String): Array[TestState] = { - val (sequentialTests, parallelTests) = + val (limitResourceTests, parallelTests) = kindFiles partition { kindFile => val flags = kindFile.changeExtension("flags").fileContents - sequentialFlags.exists(seqFlag => flags.contains(seqFlag)) + limitResourceFlags.exists(seqFlag => flags.contains(seqFlag)) } val seqResults = - if (!sequentialTests.isEmpty) { + if (!limitResourceTests.isEmpty) { val savedThreads = sys.props("partest.threads") - sys.props("partest.threads") = "2" + sys.props("partest.threads") = limitedThreads - NestUI.echo(s"## we will run ${sequentialTests.length} tests using ${PartestDefaults.numThreads} thread(s)") - val res = super.runTestsForFiles(sequentialTests, kind) + NestUI.echo(s"## we will run ${limitResourceTests.length} tests using ${PartestDefaults.numThreads} thread(s)") + val res = super.runTestsForFiles(limitResourceTests, kind) if (savedThreads != null) sys.props("partest.threads") = savedThreads |