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/10/20 04:05:36 UTC

[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #1259: [KYUUBI #1258] Implement sessions/execpool/statistic

ulysses-you commented on a change in pull request #1259:
URL: https://github.com/apache/incubator-kyuubi/pull/1259#discussion_r732399485



##########
File path: kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/SessionsResourceSuite.scala
##########
@@ -84,4 +83,32 @@ class SessionsResourceSuite extends RestApiBaseSuite {
     }
   }
 
+  @Test
+  def testExecPoolStatistic: Unit = {
+    RestFrontendServiceSuite.withKyuubiRestServer {
+      (restFrontendService: RestFrontendService, _, _) =>
+
+        val sessionManager = restFrontendService.be.sessionManager
+        sessionManager.submitBackgroundOperation(() => {
+          Thread.sleep(3000)
+        })
+
+        // verify the exec pool statistic
+        var response = target("api/v1/sessions/execpool/statistic").request().get()
+        val execPoolStatistic1 = response.readEntity(classOf[ExecPoolStatistic])
+        assert(execPoolStatistic1.execPoolSize == 1 && execPoolStatistic1.execPoolActiveCount == 1)
+
+        Thread.sleep(3000)

Review comment:
       why we need to sleep here, it's flaky and unnecessary ? we can call `future.cancel()`.




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