We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c97839a commit 2ce5760Copy full SHA for 2ce5760
core/src/test/scala/org/apache/spark/SparkContextSuite.scala
@@ -275,16 +275,14 @@ class SparkContextSuite extends SparkFunSuite with LocalSparkContext {
275
}
276
277
test("calling multiple sc.stop() must not throw any exception") {
278
- try {
+ noException should be thrownBy {
279
sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local"))
280
val cnt = sc.parallelize(1 to 4).count()
281
sc.cancelAllJobs()
282
sc.stop()
283
// call stop second time
284
285
- } catch {
286
- case e: Exception =>
287
- fail("calling multiple sc.stop() must not have thrown any exception", e);
288
289
+
290
0 commit comments