File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
core/src/test/scala/org/apache/spark Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -274,8 +274,7 @@ class SparkContextSuite extends SparkFunSuite with LocalSparkContext {
274
274
}
275
275
}
276
276
277
- test(" calling multiple sc.stop() must not throw uncaught exception(50) from sparkenv" ) {
278
- var threwNoOrOnlyExceptedException = true
277
+ test(" calling multiple sc.stop() must not throw any exception" ) {
279
278
try {
280
279
sc = new SparkContext (new SparkConf ().setAppName(" test" ).setMaster(" local" ))
281
280
val cnt = sc.parallelize(1 to 4 ).count()
@@ -284,13 +283,8 @@ class SparkContextSuite extends SparkFunSuite with LocalSparkContext {
284
283
// call stop second time
285
284
sc.stop()
286
285
} catch {
287
- case e : ServerStateException =>
288
- // assert(!e.getMessage.contains("Server is already stopped"))
289
- threwNoOrOnlyExceptedException = false
290
- case NonFatal (e) =>
291
- threwNoOrOnlyExceptedException = true
292
- } finally {
293
- assert(threwNoOrOnlyExceptedException == true )
286
+ case e : Exception =>
287
+ fail(" calling multiple sc.stop() must not have thrown any exception" );
294
288
}
295
289
}
296
290
}
You can’t perform that action at this time.
0 commit comments