diff options
author | RongGu <gurongwalker@gmail.com> | 2014-11-09 23:48:15 -0800 |
---|---|---|
committer | Patrick Wendell <pwendell@gmail.com> | 2014-11-09 23:48:35 -0800 |
commit | c127ff8c87fc4f3aa6f09697928832dc6d37cc0f (patch) | |
tree | c6365e11bdd4ad8b2124f72464c0ed3a680aac49 /core | |
parent | fb36cf9ea8d55dfe3119f6f5d8bd3e98ce68ce21 (diff) | |
download | spark-c127ff8c87fc4f3aa6f09697928832dc6d37cc0f.tar.gz spark-c127ff8c87fc4f3aa6f09697928832dc6d37cc0f.tar.bz2 spark-c127ff8c87fc4f3aa6f09697928832dc6d37cc0f.zip |
[SPARK-2703][Core]Make Tachyon related unit tests execute without deploying a Tachyon system locally.
Make Tachyon related unit tests execute without deploying a Tachyon system locally.
Author: RongGu <gurongwalker@gmail.com>
Closes #3030 from RongGu/SPARK-2703 and squashes the following commits:
ad08827 [RongGu] Make Tachyon related unit tests execute without deploying a Tachyon system locally
(cherry picked from commit bd86cb1738800a0aa4c88b9afdba2f97ac6cbf25)
Signed-off-by: Patrick Wendell <pwendell@gmail.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/pom.xml | 7 | ||||
-rw-r--r-- | core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala | 11 |
2 files changed, 16 insertions, 2 deletions
diff --git a/core/pom.xml b/core/pom.xml index 41296e0eca..92e9f1fc46 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -206,6 +206,13 @@ </dependency> <dependency> <groupId>org.tachyonproject</groupId> + <artifactId>tachyon</artifactId> + <version>0.5.0</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.tachyonproject</groupId> <artifactId>tachyon-client</artifactId> <version>0.5.0</version> <exclusions> diff --git a/core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala b/core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala index 9529502bc8..86503c9a02 100644 --- a/core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala +++ b/core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala @@ -36,6 +36,7 @@ import org.mockito.Mockito.{mock, when} import org.scalatest.{BeforeAndAfter, FunSuite, Matchers, PrivateMethodTester} import org.scalatest.concurrent.Eventually._ import org.scalatest.concurrent.Timeouts._ +import tachyon.master.LocalTachyonCluster import org.apache.spark.{MapOutputTrackerMaster, SparkConf, SparkContext, SecurityManager} import org.apache.spark.executor.DataReadMethod @@ -536,9 +537,14 @@ class BlockManagerSuite extends FunSuite with Matchers with BeforeAndAfter } test("tachyon storage") { - // TODO Make the spark.test.tachyon.enable true after using tachyon 0.5.0 testing jar. - val tachyonUnitTestEnabled = conf.getBoolean("spark.test.tachyon.enable", false) + val tachyonUnitTestEnabled = conf.getBoolean("spark.test.tachyon.enable", true) if (tachyonUnitTestEnabled) { + val tachyonCluster = new LocalTachyonCluster(30000000) + tachyonCluster.start() + val tachyonURL = tachyon.Constants.HEADER + + tachyonCluster.getMasterHostname() + ":" + tachyonCluster.getMasterPort() + conf.set("spark.tachyonStore.url", tachyonURL) + conf.set("spark.tachyonStore.folderName", "app-test") store = makeBlockManager(1200) val a1 = new Array[Byte](400) val a2 = new Array[Byte](400) @@ -549,6 +555,7 @@ class BlockManagerSuite extends FunSuite with Matchers with BeforeAndAfter assert(store.getSingle("a3").isDefined, "a3 was in store") assert(store.getSingle("a2").isDefined, "a2 was in store") assert(store.getSingle("a1").isDefined, "a1 was in store") + tachyonCluster.stop() } else { info("tachyon storage test disabled.") } |