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

    https://github.com/apache/spark/pull/6973#discussion_r33265121
  
    --- Diff: core/src/test/scala/org/apache/spark/SparkContextSuite.scala ---
    @@ -272,4 +273,24 @@ class SparkContextSuite extends SparkFunSuite with 
LocalSparkContext {
           sc.stop()
         }
       }
    +
    +  test("calling multiple sc.stop() must not throw uncaught exception(50) 
from sparkenv") {
    +    var threwNoOrOnlyExceptedException = true
    +    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: ServerStateException =>
    +        // assert(!e.getMessage.contains("Server is already stopped"))
    +        threwNoOrOnlyExceptedException = false
    +      case NonFatal(e) =>
    +        threwNoOrOnlyExceptedException = true
    --- End diff --
    
    what exception are you expecting here?  I don't see any exception when 
running this test locally.
    
    If you aren't expecting any exception, then you could just have the body of 
the `try` block in the test (any exception will fail the test).
    
    If there is some "OK" exception, we should probably check more directly for 
that exception, as this will allow almost any exception to get thrown.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to