diff options
author | Sean Owen <sowen@cloudera.com> | 2016-04-05 19:57:23 -0700 |
---|---|---|
committer | Shixiong Zhu <shixiong@databricks.com> | 2016-04-05 19:57:23 -0700 |
commit | 8e5c1cbf2c3d5eaa7d9dd35def177414a0d4cf82 (patch) | |
tree | 4f07bc782342195e8423c2844d2e4e9459232b2a /streaming/src/test | |
parent | 7d29c72f64f8637d8182fb7c495f87ab7ce86ea0 (diff) | |
download | spark-8e5c1cbf2c3d5eaa7d9dd35def177414a0d4cf82.tar.gz spark-8e5c1cbf2c3d5eaa7d9dd35def177414a0d4cf82.tar.bz2 spark-8e5c1cbf2c3d5eaa7d9dd35def177414a0d4cf82.zip |
[SPARK-13211][STREAMING] StreamingContext throws NoSuchElementException when created from non-existent checkpoint directory
## What changes were proposed in this pull request?
Take 2: avoid None.get NoSuchElementException in favor of more descriptive IllegalArgumentException if a non-existent checkpoint dir is used without a SparkContext
## How was this patch tested?
Jenkins test plus new test for this particular case
Author: Sean Owen <sowen@cloudera.com>
Closes #12174 from srowen/SPARK-13211.
Diffstat (limited to 'streaming/src/test')
-rw-r--r-- | streaming/src/test/scala/org/apache/spark/streaming/CheckpointSuite.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/streaming/src/test/scala/org/apache/spark/streaming/CheckpointSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/CheckpointSuite.scala index 9a3248b3e8..fbb25d4c59 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/CheckpointSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/CheckpointSuite.scala @@ -228,6 +228,11 @@ class CheckpointSuite extends TestSuiteBase with DStreamCheckpointTester } } + test("non-existent checkpoint dir") { + // SPARK-13211 + intercept[IllegalArgumentException](new StreamingContext("nosuchdirectory")) + } + test("basic rdd checkpoints + dstream graph checkpoint recovery") { assert(batchDuration === Milliseconds(500), "batchDuration for this test must be 1 second") |