aboutsummaryrefslogtreecommitdiff
path: root/streaming
diff options
context:
space:
mode:
authorShixiong Zhu <shixiong@databricks.com>2016-03-05 15:26:27 -0800
committerShixiong Zhu <shixiong@databricks.com>2016-03-05 15:26:27 -0800
commit8290004d94760c22d6d3ca8dda3003ac8644422f (patch)
treec2305f4c16b1879a8f6e11d8c9875da98563268b /streaming
parentadce5ee721c6a844ff21dfcd8515859458fe611d (diff)
downloadspark-8290004d94760c22d6d3ca8dda3003ac8644422f.tar.gz
spark-8290004d94760c22d6d3ca8dda3003ac8644422f.tar.bz2
spark-8290004d94760c22d6d3ca8dda3003ac8644422f.zip
[SPARK-13693][STREAMING][TESTS] Stop StreamingContext before deleting checkpoint dir
## What changes were proposed in this pull request? Stop StreamingContext before deleting checkpoint dir to avoid the race condition that deleting the checkpoint dir and writing checkpoint happen at the same time. The flaky test log is here: https://amplab.cs.berkeley.edu/jenkins/job/spark-master-test-sbt-hadoop-2.7/256/testReport/junit/org.apache.spark.streaming/MapWithStateSuite/_It_is_not_a_test_/ ## How was this patch tested? unit tests Author: Shixiong Zhu <shixiong@databricks.com> Closes #11531 from zsxwing/SPARK-13693.
Diffstat (limited to 'streaming')
-rw-r--r--streaming/src/test/scala/org/apache/spark/streaming/MapWithStateSuite.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/streaming/src/test/scala/org/apache/spark/streaming/MapWithStateSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/MapWithStateSuite.scala
index b6d6585bd8..403400904b 100644
--- a/streaming/src/test/scala/org/apache/spark/streaming/MapWithStateSuite.scala
+++ b/streaming/src/test/scala/org/apache/spark/streaming/MapWithStateSuite.scala
@@ -43,10 +43,10 @@ class MapWithStateSuite extends SparkFunSuite
}
after {
+ StreamingContext.getActive().foreach { _.stop(stopSparkContext = false) }
if (checkpointDir != null) {
Utils.deleteRecursively(checkpointDir)
}
- StreamingContext.getActive().foreach { _.stop(stopSparkContext = false) }
}
override def beforeAll(): Unit = {