You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2021/07/23 08:09:18 UTC

[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #861: [KYUUBI #845] Event tracking for stageInfo: Getting metrics in stage's lifecycle and store them in mem

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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org