zwangsheng commented on code in PR #5352:
URL: https://github.com/apache/kyuubi/pull/5352#discussion_r1356003785
##########
kyuubi-server/src/test/scala/org/apache/kyuubi/server/metadata/MetadataManagerSuite.scala:
##########
@@ -142,6 +145,94 @@ class MetadataManagerSuite extends KyuubiFunSuite {
}
}
+ test("[KYUUBI #5328] Test MetadataManager#pickBatchForSubmitting in order") {
+ withMetadataManager(Map(METADATA_STORE_JDBC_PRIORITY_ENABLED.key ->
"true")) {
+ metadataManager =>
+ val mockKyuubiInstance = "mock_kyuubi_instance"
+ val time = System.currentTimeMillis()
+ val mockBatchJob1 = Metadata(
+ identifier = "mock_batch_job_1",
+ sessionType = SessionType.BATCH,
+ realUser = "kyuubi",
+ username = "kyuubi",
+ engineType = EngineType.SPARK_SQL.toString,
+ state = OperationState.INITIALIZED.toString,
+ priority = 20,
+ createTime = time + 10000)
+ val mockBatchJob2 = Metadata(
+ identifier = "mock_batch_job_2",
+ sessionType = SessionType.BATCH,
+ realUser = "kyuubi",
+ username = "kyuubi",
+ engineType = EngineType.SPARK_SQL.toString,
+ state = OperationState.INITIALIZED.toString,
+ createTime = time)
+ val mockBatchJob3 = Metadata(
+ identifier = "mock_batch_job_3",
+ sessionType = SessionType.BATCH,
+ realUser = "kyuubi",
+ username = "kyuubi",
+ engineType = EngineType.SPARK_SQL.toString,
+ state = OperationState.INITIALIZED.toString,
+ createTime = time + 10000)
Review Comment:
Sure.
Reused and modified `newMetadata` method to build mock batch job and keep
use same mock object in both positive and negative case.
--
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]