Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6973#discussion_r33335942
  
    --- Diff: core/src/test/scala/org/apache/spark/SparkContextSuite.scala ---
    @@ -272,4 +273,18 @@ class SparkContextSuite extends SparkFunSuite with 
LocalSparkContext {
           sc.stop()
         }
       }
    +
    +  test("calling multiple sc.stop() must not throw any exception") {
    +    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 =>
    --- End diff --
    
    This `try` should be removed since it doesn't really add anything, except 
hiding the exception. Let it fly from the method to fail the test.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to