From 7dbf632f5d2c4f6f5c30a7435b9456b711e91bf2 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Sun, 17 Jan 2016 15:29:18 +0100 Subject: [PATCH] Use one less thread than we have cores on Jenkins, increase max heap Using less threads should allow us to increase the maximum heap size without filling up the memory of the Jenkins instance --- project/Build.scala | 4 +--- test/dotty/partest/DPConsoleRunner.scala | 7 +++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index b0bad8f4ca20..3ecb9ac42de3 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -6,9 +6,7 @@ import scala.reflect.io.Path object DottyBuild extends Build { - // Currently, this cannot be increased without hitting the maximum amount of memory - // available on the Jenkins VMs - val travisMemLimit = List("-Xmx1100m") + val travisMemLimit = List("-Xmx1500m") val JENKINS_BUILD = "dotty.jenkins.build" diff --git a/test/dotty/partest/DPConsoleRunner.scala b/test/dotty/partest/DPConsoleRunner.scala index fa6256398d47..834ca14b690a 100644 --- a/test/dotty/partest/DPConsoleRunner.scala +++ b/test/dotty/partest/DPConsoleRunner.scala @@ -68,8 +68,15 @@ class DPSuiteRunner(testSourcePath: String, // relative path, like "files", or " scalacExtraArgs: Seq[String] = Seq.empty) extends SuiteRunner(testSourcePath, fileManager, updateCheck, failed, javaCmdPath, javacCmdPath, scalacExtraArgs) { + val isJenkins = sys.props.isDefinedAt("dotty.jenkins.build") + val numCores = Runtime.getRuntime.availableProcessors + if (!DPConfig.runTestsInParallel) sys.props("partest.threads") = "1" + else if (isJenkins) + sys.props("partest.threads") = ((numCores - 1) max 1).toString + else + sys.props("partest.threads") = numCores.toString sys.props("partest.root") = "."