yaooqinn commented on a change in pull request #861:
URL: https://github.com/apache/incubator-kyuubi/pull/861#discussion_r675380572
##########
File path:
externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/KyuubiStatementMonitorSuite.scala
##########
@@ -118,6 +118,29 @@ class KyuubiStatementMonitorSuite extends
WithSparkSQLEngine with HiveJDBCTests
}
}
+ test("add kyuubiStageInfo into queue") {
+ val sql = "select timestamp'2021-06-01'"
+ val getQueue = PrivateMethod[
+ ArrayBlockingQueue[KyuubiStageInfo]](Symbol("kyuubiStageInfoQueue"))()
+ val kyuubiStageQueue = KyuubiStatementMonitor.invokePrivate(getQueue)
+ kyuubiStageQueue.clear()
+ withSessionHandle { (client, handle) =>
+ val req = new TExecuteStatementReq()
+ req.setSessionHandle(handle)
+ req.setStatement(sql)
+ val tExecuteStatementResp = client.ExecuteStatement(req)
+ val opHandle = tExecuteStatementResp.getOperationHandle
+
+ eventually(timeout(10.seconds), interval(100.milliseconds)) {
+ assert(kyuubiStageQueue.size() === 1)
+
+ val kyuubiStageInfo = kyuubiStageQueue.peek()
+ assert(kyuubiStageInfo.statementId ===
OperationHandle(opHandle).identifier.toString)
+ assert(kyuubiStageInfo.stageInfo.completionTime !== None)
Review comment:
nit: .nonEmpty
--
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]