diff options
author | Hari Shreedharan <hshreedharan@apache.org> | 2015-02-21 10:01:01 -0800 |
---|---|---|
committer | Andrew Or <andrew@databricks.com> | 2015-02-21 10:01:01 -0800 |
commit | 7138816abe1060a1e967c4c77c72d5752586d557 (patch) | |
tree | c13120bff49220941bbe5d150ab41b499d9e0cd9 | |
parent | d3cbd38c33e6a2addcf8caa18eeb10036fbfd01b (diff) | |
download | spark-7138816abe1060a1e967c4c77c72d5752586d557.tar.gz spark-7138816abe1060a1e967c4c77c72d5752586d557.tar.bz2 spark-7138816abe1060a1e967c4c77c72d5752586d557.zip |
[SPARK-5937][YARN] Fix ClientSuite to set YARN mode, so that the correct class is used in t...
...ests.
Without this SparkHadoopUtil is used by the Client instead of YarnSparkHadoopUtil.
Author: Hari Shreedharan <hshreedharan@apache.org>
Closes #4711 from harishreedharan/SPARK-5937 and squashes the following commits:
d154de6 [Hari Shreedharan] Use System.clearProperty() instead of setting the value of SPARK_YARN_MODE to empty string.
f729f70 [Hari Shreedharan] Fix ClientSuite to set YARN mode, so that the correct class is used in tests.
-rw-r--r-- | yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala b/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala index f8f8129d22..92f04b4b85 100644 --- a/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala +++ b/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala @@ -28,8 +28,7 @@ import org.apache.hadoop.yarn.api.records._ import org.apache.hadoop.yarn.conf.YarnConfiguration import org.mockito.Matchers._ import org.mockito.Mockito._ -import org.scalatest.FunSuite -import org.scalatest.Matchers +import org.scalatest.{BeforeAndAfterAll, FunSuite, Matchers} import scala.collection.JavaConversions._ import scala.collection.mutable.{ HashMap => MutableHashMap } @@ -39,7 +38,15 @@ import scala.util.Try import org.apache.spark.{SparkException, SparkConf} import org.apache.spark.util.Utils -class ClientSuite extends FunSuite with Matchers { +class ClientSuite extends FunSuite with Matchers with BeforeAndAfterAll { + + override def beforeAll(): Unit = { + System.setProperty("SPARK_YARN_MODE", "true") + } + + override def afterAll(): Unit = { + System.clearProperty("SPARK_YARN_MODE") + } test("default Yarn application classpath") { Client.getDefaultYarnApplicationClasspath should be(Some(Fixtures.knownDefYarnAppCP)) |