@@ -36,6 +36,7 @@ import org.mockito.Mockito.{mock, when}
3636import org .scalatest .{BeforeAndAfter , FunSuite , Matchers , PrivateMethodTester }
3737import org .scalatest .concurrent .Eventually ._
3838import org .scalatest .concurrent .Timeouts ._
39+ import tachyon .master .LocalTachyonCluster
3940
4041import org .apache .spark .{MapOutputTrackerMaster , SecurityManager , SparkConf }
4142import org .apache .spark .executor .DataReadMethod
@@ -532,9 +533,14 @@ class BlockManagerSuite extends FunSuite with Matchers with BeforeAndAfter
532533 }
533534
534535 test(" tachyon storage" ) {
535- // TODO Make the spark.test.tachyon.enable true after using tachyon 0.5.0 testing jar.
536- val tachyonUnitTestEnabled = conf.getBoolean(" spark.test.tachyon.enable" , false )
536+ val tachyonUnitTestEnabled = conf.getBoolean(" spark.test.tachyon.enable" , true )
537537 if (tachyonUnitTestEnabled) {
538+ val tachyonCluster = new LocalTachyonCluster (30000000 )
539+ tachyonCluster.start()
540+ val tachyonURL = tachyon.Constants .HEADER +
541+ tachyonCluster.getMasterHostname() + " :" + tachyonCluster.getMasterPort()
542+ conf.set(" spark.tachyonStore.url" , tachyonURL)
543+ conf.set(" spark.tachyonStore.folderName" , " app-test" )
538544 store = makeBlockManager(1200 )
539545 val a1 = new Array [Byte ](400 )
540546 val a2 = new Array [Byte ](400 )
@@ -545,6 +551,7 @@ class BlockManagerSuite extends FunSuite with Matchers with BeforeAndAfter
545551 assert(store.getSingle(" a3" ).isDefined, " a3 was in store" )
546552 assert(store.getSingle(" a2" ).isDefined, " a2 was in store" )
547553 assert(store.getSingle(" a1" ).isDefined, " a1 was in store" )
554+ tachyonCluster.stop()
548555 } else {
549556 info(" tachyon storage test disabled." )
550557 }
0 commit comments