cfmcgrady commented on code in PR #2636:
URL: https://github.com/apache/incubator-kyuubi/pull/2636#discussion_r870968479


##########
kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/BatchesResourceSuite.scala:
##########
@@ -33,9 +33,24 @@ import 
org.apache.kyuubi.config.KyuubiConf.{ENGINE_CHECK_INTERVAL, ENGINE_SPARK_
 import org.apache.kyuubi.engine.spark.SparkProcessBuilder
 import 
org.apache.kyuubi.server.http.authentication.AuthenticationHandler.AUTHORIZATION_HEADER
 import org.apache.kyuubi.service.authentication.KyuubiAuthenticationFactory
-import org.apache.kyuubi.session.KyuubiSessionManager
+import org.apache.kyuubi.session.{KyuubiBatchSessionImpl, KyuubiSessionManager}
 
 class BatchesResourceSuite extends KyuubiFunSuite with RestFrontendTestHelper {
+
+  override def afterEach(): Unit = {
+    val sessionManager = fe.be.sessionManager
+    sessionManager.asInstanceOf[KyuubiSessionManager]
+      .getBatchSessionList(null, 0, 0)

Review Comment:
   If one unit test exits unexpectedly, it may cause the second unit test to 
fail.`get batch session list` failed due to we did not clean up the existing 
batch session when `open batch session` failed
   
   ```
   - get batch session list *** FAILED ***
     List(Batch(d860929f-f1a8-4f0d-890d-d06d895b48d8,spark,Map(id -> 21071, 
name ->  org.apache.spark.deploy.SparkSubmit --conf spark.master=local --conf 
spark.kyuubi.session.engine.spark.max.lifetime=5000 --conf 
spark.kyuubi.session.engine.check.interval=1000 --conf 
spark.yarn.tags=d860929f-f1a8-4f0d-890d-d06d895b48d8 --conf 
spark.app.name=spark-batch-submission --class 
org.apache.kyuubi.engine.spark.SparkSQLEngine --proxy-user anonymous 
/home/runner/work/incubator-kyuubi/incubator-kyuubi/externals/kyuubi-spark-sql-engine/target/kyuubi-spark-sql-engine_2.12-1.6.0-SNAPSHOT.jar,
 state -> RUNNING),localhost:37119,CLOSED)) was not empty 
(BatchesResourceSuite.scala:169)
   ```



-- 
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]

Reply via email to