pan3793 commented on code in PR #5313:
URL: https://github.com/apache/kyuubi/pull/5313#discussion_r1333959999
##########
kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/BatchesResourceSuite.scala:
##########
@@ -576,23 +576,40 @@ abstract class BatchesResourceSuiteBase extends
KyuubiFunSuite
val restFe = fe.asInstanceOf[KyuubiRestFrontendService]
restFe.recoverBatchSessions()
- assert(sessionManager.getOpenSessionCount === 2)
-
- val sessionHandle1 = SessionHandle.fromUUID(batchId1)
- val sessionHandle2 = SessionHandle.fromUUID(batchId2)
- val session1 =
sessionManager.getSession(sessionHandle1).asInstanceOf[KyuubiBatchSession]
- val session2 =
sessionManager.getSession(sessionHandle2).asInstanceOf[KyuubiBatchSession]
- assert(session1.createTime === batchMetadata.createTime)
- assert(session2.createTime === batchMetadata2.createTime)
-
- eventually(timeout(10.seconds)) {
- assert(session1.batchJobSubmissionOp.getStatus.state ===
OperationState.RUNNING ||
- session1.batchJobSubmissionOp.getStatus.state ===
OperationState.FINISHED)
- assert(session1.batchJobSubmissionOp.builder.processLaunched)
-
- assert(session2.batchJobSubmissionOp.getStatus.state ===
OperationState.RUNNING ||
- session2.batchJobSubmissionOp.getStatus.state ===
OperationState.FINISHED)
- assert(!session2.batchJobSubmissionOp.builder.processLaunched)
+ batchVersion match {
+ case "1" =>
+ assert(sessionManager.getOpenSessionCount === 2)
+
+ val sessionHandle1 = SessionHandle.fromUUID(batchId1)
+ val sessionHandle2 = SessionHandle.fromUUID(batchId2)
+ val session1 =
sessionManager.getSession(sessionHandle1).asInstanceOf[KyuubiBatchSession]
+ val session2 =
sessionManager.getSession(sessionHandle2).asInstanceOf[KyuubiBatchSession]
+ assert(session1.createTime === batchMetadata.createTime)
+ assert(session2.createTime === batchMetadata2.createTime)
+
+ eventually(timeout(10.seconds)) {
+ assert(session1.batchJobSubmissionOp.getStatus.state ===
OperationState.RUNNING ||
+ session1.batchJobSubmissionOp.getStatus.state ===
OperationState.FINISHED)
+ assert(session1.batchJobSubmissionOp.builder.processLaunched)
+
+ assert(session2.batchJobSubmissionOp.getStatus.state ===
OperationState.RUNNING ||
+ session2.batchJobSubmissionOp.getStatus.state ===
OperationState.FINISHED)
+ assert(!session2.batchJobSubmissionOp.builder.processLaunched)
+ }
+ case "2" =>
Review Comment:
the check for 2 seems much lenient than 1, can we make it strict?
--
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]