fwc commented on code in PR #56190:
URL: https://github.com/apache/spark/pull/56190#discussion_r3454500734
##########
sql/core/src/test/scala/org/apache/spark/sql/test/SharedSparkSession.scala:
##########
@@ -19,40 +19,13 @@ package org.apache.spark.sql.test
import scala.concurrent.duration._
-import org.scalatest.{BeforeAndAfterEach, Suite}
-import org.scalatest.concurrent.Eventually
+import org.scalatest.Suite
-import org.apache.spark.{DebugFilesystem, SparkConf}
-import org.apache.spark.internal.config.UNSAFE_EXCEPTION_ON_MEMORY_LEAK
-import org.apache.spark.sql.{classic, QueryTest, QueryTestBase, SparkSession,
SparkSessionProvider, SQLContext}
-import org.apache.spark.sql.catalyst.expressions.CodegenObjectFactoryMode
-import org.apache.spark.sql.catalyst.optimizer.ConvertToLocalRelation
-import org.apache.spark.sql.internal.{SQLConf, StaticSQLConf}
+import org.apache.spark.sql.{QueryTest, QueryTestBase, SparkSessionBinderBase}
+import org.apache.spark.sql.classic
-trait SharedSparkSession extends QueryTest with SharedSparkSessionBase {
-
- /**
- * Suites extending [[SharedSparkSession]] are sharing resources (e.g.
SparkSession) in their
- * tests. That trait initializes the spark session in its [[beforeAll()]]
implementation before
- * the automatic thread snapshot is performed, so the audit code could fail
to report threads
- * leaked by that shared session.
- *
- * The behavior is overridden here to take the snapshot before the spark
session is initialized.
- */
- override protected val enableAutoThreadAudit = false
-
- protected override def beforeAll(): Unit = {
- doThreadPreAudit()
- super.beforeAll()
- }
-
- protected override def afterAll(): Unit = {
- try {
- super.afterAll()
- } finally {
- doThreadPostAudit()
- }
- }
+@deprecated("Use SessionQueryTest (or classic.SessionQueryTest if required)
instead", "4.2.0")
Review Comment:
@cloud-fan @ionagamed @johanl-db I'm unsure wether we should immediately
deprecate `SharedSparkSession` or only do that after we spent some time using
`SessionQueryTest` ourselves.
Maybe it's better if we find potential 'UX gaps' ourselves 😅
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]