Skip to content

Commit d56c45c

Browse files
committed
Reduce running time of testPickling
testPickling pickled directories recursively. It seems this was unintentional as it caused testPickling to test most files of the dotty compiler three times, including two runs where basically the whole compiler was tested together. This was very slow as pickling (and retaining pickled info) caused very high memory pressure. We now compile root compiler directories non-recursively.
1 parent 7848ef6 commit d56c45c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,14 @@ class CompilationTests extends ParallelTesting {
210210

211211
@Test def testPickling: Unit = {
212212
implicit val testGroup: TestGroup = TestGroup("testPickling")
213-
compileDir("../compiler/src/dotty/tools", picklingOptions) +
214-
compileDir("../compiler/src/dotty/tools/dotc", picklingOptions) +
213+
compileDir("../compiler/src/dotty/tools", picklingOptions, recursive = false) +
214+
compileDir("../compiler/src/dotty/tools/dotc", picklingOptions, recursive = false) +
215215
compileFilesInDir("../tests/new", picklingOptions) +
216216
compileFilesInDir("../tests/pickling", picklingOptions) +
217217
compileDir("../library/src/dotty/runtime", picklingOptions) +
218218
compileDir("../compiler/src/dotty/tools/backend/jvm", picklingOptions) +
219219
compileDir("../compiler/src/dotty/tools/dotc/ast", picklingOptions) +
220-
compileDir("../compiler/src/dotty/tools/dotc/core", picklingOptions) +
220+
compileDir("../compiler/src/dotty/tools/dotc/core", picklingOptions, recursive = false) +
221221
compileDir("../compiler/src/dotty/tools/dotc/config", picklingOptions) +
222222
compileDir("../compiler/src/dotty/tools/dotc/parsing", picklingOptions) +
223223
compileDir("../compiler/src/dotty/tools/dotc/printing", picklingOptions) +

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,13 +1113,16 @@ trait ParallelTesting extends RunnerOrchestration { self =>
11131113
* By default, files are compiled in alphabetical order. An optional seed
11141114
* can be used for randomization.
11151115
*/
1116-
def compileDir(f: String, flags: TestFlags, randomOrder: Option[Int] = None)(implicit testGroup: TestGroup): CompilationTest = {
1116+
def compileDir(f: String, flags: TestFlags, randomOrder: Option[Int] = None, recursive: Boolean = true)(implicit testGroup: TestGroup): CompilationTest = {
11171117
val outDir = defaultOutputDir + testGroup + "/"
11181118
val sourceDir = new JFile(f)
11191119
checkRequirements(f, sourceDir, outDir)
11201120

11211121
def flatten(f: JFile): Array[JFile] =
1122-
if (f.isDirectory) f.listFiles.flatMap(flatten)
1122+
if (f.isDirectory) {
1123+
val files = f.listFiles
1124+
if (recursive) files.flatMap(flatten) else files
1125+
}
11231126
else Array(f)
11241127

11251128
// Sort files either alphabetically or randomly using the provided seed:

0 commit comments

Comments
 (0)