diff options
author | Lars Albertsson <lalle@spotify.com> | 2014-06-11 10:54:42 -0700 |
---|---|---|
committer | Patrick Wendell <pwendell@gmail.com> | 2014-06-11 10:56:01 -0700 |
commit | 684a93a7263a79c612275ba36e06f6438162ff28 (patch) | |
tree | a7da83541c46c6ec26ed7e7aa85982f61571f6f3 /streaming/src/test | |
parent | 9ef076510e832a4cd56d692937b597e573187416 (diff) | |
download | spark-684a93a7263a79c612275ba36e06f6438162ff28.tar.gz spark-684a93a7263a79c612275ba36e06f6438162ff28.tar.bz2 spark-684a93a7263a79c612275ba36e06f6438162ff28.zip |
SPARK-2113: awaitTermination() after stop() will hang in Spark Stremaing
Author: Lars Albertsson <lalle@spotify.com>
Closes #1001 from lallea/contextwaiter_stopped and squashes the following commits:
93cd314 [Lars Albertsson] Mend StreamingContext stop() followed by awaitTermination().
(cherry picked from commit 4d5c12aa1c54c49377a4bafe3bcc4993d5e1a552)
Signed-off-by: Patrick Wendell <pwendell@gmail.com>
Diffstat (limited to 'streaming/src/test')
-rw-r--r-- | streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala index cd86019f63..7b33d3b235 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala @@ -223,6 +223,18 @@ class StreamingContextSuite extends FunSuite with BeforeAndAfter with Timeouts w } } + test("awaitTermination after stop") { + ssc = new StreamingContext(master, appName, batchDuration) + val inputStream = addInputStream(ssc) + inputStream.map(x => x).register() + + failAfter(10000 millis) { + ssc.start() + ssc.stop() + ssc.awaitTermination() + } + } + test("awaitTermination with error in task") { ssc = new StreamingContext(master, appName, batchDuration) val inputStream = addInputStream(ssc) |