Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,13 @@
<artifactId>derby</artifactId>
<scope>test</scope>
</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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, SecurityManager, SparkConf}
import org.apache.spark.executor.DataReadMethod
Expand Down Expand Up @@ -532,9 +533,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)
Expand All @@ -545,6 +551,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.")
}
Expand Down
2 changes: 2 additions & 0 deletions project/SparkBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ object TestSettings {
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a"),
// Enable Junit testing.
libraryDependencies += "com.novocode" % "junit-interface" % "0.9" % "test",
// Enable Tachyon local testing.
libraryDependencies += "org.tachyonproject" % "tachyon" % "0.5.0" % "test" classifier "tests",
// Only allow one test at a time, even across projects, since they run in the same JVM
parallelExecution in Test := false,
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1),
Expand Down