You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2026/08/07 12:59:08 UTC
Re: [PR] [SPARK-58407][SQL][TESTS][CONNECT] Fix connect.SessionQueryTest beforeAll, afterAll [spark]
cloud-fan commented on code in PR #57606:
URL: https://github.com/apache/spark/pull/57606#discussion_r3735901013
##########
sql/connect/server/src/test/scala/org/apache/spark/sql/connect/SparkSessionBinder.scala:
##########
@@ -60,14 +61,15 @@ trait SparkSessionBinder extends sql.SparkSessionBinder { self: SparkFunSuite =>
.builder()
.client(client)
.create()
+ super.beforeAll()
}
override def afterAll(): Unit = {
+ super.afterAll()
Review Comment:
Please keep cleanup in a `finally` block after invoking the suite hooks. If `super.afterAll()` throws (including from the new suite's SQL assertion), this method now skips closing `_connectSpark` and stopping the global service, which can contaminate later suites. The classic binder preserves this guarantee with `try`/`finally`.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org