aboutsummaryrefslogtreecommitdiff
path: root/streaming
diff options
context:
space:
mode:
Diffstat (limited to 'streaming')
-rw-r--r--streaming/src/test/scala/org/apache/spark/streaming/TestSuiteBase.scala17
1 files changed, 11 insertions, 6 deletions
diff --git a/streaming/src/test/scala/org/apache/spark/streaming/TestSuiteBase.scala b/streaming/src/test/scala/org/apache/spark/streaming/TestSuiteBase.scala
index f095da9cb5..759baacaa4 100644
--- a/streaming/src/test/scala/org/apache/spark/streaming/TestSuiteBase.scala
+++ b/streaming/src/test/scala/org/apache/spark/streaming/TestSuiteBase.scala
@@ -17,18 +17,18 @@
package org.apache.spark.streaming
-import org.apache.spark.streaming.dstream.{DStream, InputDStream, ForEachDStream}
-import org.apache.spark.streaming.util.ManualClock
+import java.io.{ObjectInputStream, IOException}
import scala.collection.mutable.ArrayBuffer
import scala.collection.mutable.SynchronizedBuffer
import scala.reflect.ClassTag
-import java.io.{ObjectInputStream, IOException}
-
import org.scalatest.{BeforeAndAfter, FunSuite}
+import com.google.common.io.Files
-import org.apache.spark.{SparkContext, SparkConf, Logging}
+import org.apache.spark.streaming.dstream.{DStream, InputDStream, ForEachDStream}
+import org.apache.spark.streaming.util.ManualClock
+import org.apache.spark.{SparkConf, Logging}
import org.apache.spark.rdd.RDD
/**
@@ -119,7 +119,12 @@ trait TestSuiteBase extends FunSuite with BeforeAndAfter with Logging {
def batchDuration = Seconds(1)
// Directory where the checkpoint data will be saved
- def checkpointDir = "checkpoint"
+ lazy val checkpointDir = {
+ val dir = Files.createTempDir()
+ logDebug(s"checkpointDir: $dir")
+ dir.deleteOnExit()
+ dir.toString
+ }
// Number of partitions of the input parallel collections created for testing
def numInputPartitions = 2