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 29, 2015
1 parent c97839a commit 2ce5760
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/src/test/scala/org/apache/spark/SparkContextSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -275,16 +275,14 @@ class SparkContextSuite extends SparkFunSuite with LocalSparkContext {
}

test("calling multiple sc.stop() must not throw any exception") {
try {
noException should be thrownBy {
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 2ce5760

Please sign in to comment.