Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,6 @@ class StreamingContextSuite extends SparkFunSuite with BeforeAndAfter with Timeo
val conf = new SparkConf().setMaster("local-cluster[2,1,1024]").setAppName(appName)
ssc = new StreamingContext(conf, Milliseconds(100))
val input = ssc.receiverStream(new TestReceiver)
val latch = new CountDownLatch(1)
@volatile var stopping = false
input.count().foreachRDD { rdd =>
// Make sure we can read from BlockRDD
Expand All @@ -823,18 +822,14 @@ class StreamingContextSuite extends SparkFunSuite with BeforeAndAfter with Timeo
new Thread() {
setDaemon(true)
override def run(): Unit = {
ssc.stop(stopSparkContext = true, stopGracefully = false)
latch.countDown()
ssc.stop(stopSparkContext = false, stopGracefully = false)
}
}.start()
}
}
ssc.start()
ssc.awaitTerminationOrTimeout(60000)
// Wait until `ssc.top` returns. Otherwise, we may finish this test too fast and leak an active
// SparkContext. Note: the stop codes in `after` will just do nothing if `ssc.stop` in this test
// is running.
assert(latch.await(60, TimeUnit.SECONDS))
ssc.sc.stop()
}

def addInputStream(s: StreamingContext): DStream[Int] = {
Expand Down