Skip to content

Commit

Permalink
Fix for SparkContext stop behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
rekhajoshm committed Jun 26, 2015
1 parent 1aff39c commit c97839a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/test/scala/org/apache/spark/SparkContextSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,16 @@ class SparkContextSuite extends SparkFunSuite with LocalSparkContext {
}

test("calling multiple sc.stop() must not throw any exception") {
noException should be thrownBy {
try {
sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local"))
val cnt = sc.parallelize(1 to 4).count()
sc.cancelAllJobs()
sc.stop()
// call stop second time
sc.stop()
} catch {
case e: Exception =>
fail("calling multiple sc.stop() must not have thrown any exception", e);
}
}
}

0 comments on commit c97839a

Please sign in to comment.