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

    https://github.com/apache/spark/pull/19893#discussion_r161293095
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/test/SharedSQLContext.scala ---
    @@ -17,4 +17,37 @@
     
     package org.apache.spark.sql.test
     
    -trait SharedSQLContext extends SQLTestUtils with SharedSparkSession
    +trait SharedSQLContext extends SQLTestUtils with SharedSparkSession {
    +
    +  /**
    +   * Suites extending [[SharedSQLContext]] are sharing resources (eg. 
SparkSession) in their tests.
    +   * Such resources are initialized by the suite before thread audit takes 
thread snapshot and
    --- End diff --
    
    Sorry but this still does not explain why this is happening. It's just 
stating that it is.
    
    For example, in `SharedSparkSession`, there is this code:
    
    ```
      protected override def afterAll(): Unit = {
        super.afterAll()
        if (_spark != null) {
          _spark.sessionState.catalog.reset()
          _spark.stop()
          _spark = null
        }
      }
    ```
    
    If you move `super.afterAll()` to after the session is stopped, won't that 
solve the problem and avoid this?


---

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

Reply via email to