From 38c42f18ab24c8e3aecce0e39f0f2fa996627ec4 Mon Sep 17 00:00:00 2001 From: Davies Liu Date: Sat, 15 Nov 2014 22:18:07 -0800 Subject: [PATCH] fix tests --- .../main/scala/org/apache/spark/ui/ConsoleProgressBar.scala | 6 +++++- project/SparkBuild.scala | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/org/apache/spark/ui/ConsoleProgressBar.scala b/core/src/main/scala/org/apache/spark/ui/ConsoleProgressBar.scala index 14dbf99830048..980372fb9caca 100644 --- a/core/src/main/scala/org/apache/spark/ui/ConsoleProgressBar.scala +++ b/core/src/main/scala/org/apache/spark/ui/ConsoleProgressBar.scala @@ -36,7 +36,11 @@ private[spark] class ConsoleProgressBar(sc: SparkContext) extends Logging { // Delay to show up a progress bar, in milli seconds val DELAY_SHOW_UP = 500L // The width of terminal - val TerminalWidth = sys.env.getOrElse("COLUMNS", "80").toInt + val TerminalWidth = if (!sys.env.getOrElse("COLUMNS", "").isEmpty) { + sys.env.get("COLUMNS").get.toInt + } else { + 80 + } @volatile var hasShowed = false diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala index 173e0d5f32467..b03a220ed0e0f 100644 --- a/project/SparkBuild.scala +++ b/project/SparkBuild.scala @@ -377,7 +377,7 @@ object TestSettings { javaOptions in Test += "-Dspark.testing=1", javaOptions in Test += "-Dspark.port.maxRetries=100", javaOptions in Test += "-Dspark.ui.enabled=false", - javaOptions in Test += "-Dspark.ui.showProgressBar=false", + javaOptions in Test += "-Dspark.ui.showConsoleProgress=false", javaOptions in Test += "-Dsun.io.serialization.extendedDebugInfo=true", javaOptions in Test ++= System.getProperties.filter(_._1 startsWith "spark") .map { case (k,v) => s"-D$k=$v" }.toSeq,