From de2e11c2bc67f5d92e1553f8fdacaa97264769b6 Mon Sep 17 00:00:00 2001 From: ulysses-you Date: Mon, 27 Jun 2022 09:51:22 +0800 Subject: [PATCH] [KYUUBI #2924] Correct the frontend server start state ### _Why are the changes needed?_ CI has a lot of flaky test, it is because we will mark server is started when we call thread.start, but the server (bianry or http) may not be work at that moment. As a result, the client can not connect a started server. ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #2925 from ulysses-you/correct-start-state. Closes #2924 b5a30696 [ulysses-you] test bb4b4a8a [ulysses-you] sleep Authored-by: ulysses-you Signed-off-by: ulysses-you --- .../KyuubiOperationThriftHttpKerberosAndPlainAuthSuite.scala | 5 +++++ .../thrift/http/KyuubiOperationThriftHttpPerUserSuite.scala | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/thrift/http/KyuubiOperationThriftHttpKerberosAndPlainAuthSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/thrift/http/KyuubiOperationThriftHttpKerberosAndPlainAuthSuite.scala index 8ca44e993..2135fc71f 100644 --- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/thrift/http/KyuubiOperationThriftHttpKerberosAndPlainAuthSuite.scala +++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/thrift/http/KyuubiOperationThriftHttpKerberosAndPlainAuthSuite.scala @@ -27,6 +27,11 @@ import org.apache.kyuubi.service.authentication.UserDefineAuthenticationProvider class KyuubiOperationThriftHttpKerberosAndPlainAuthSuite extends KyuubiOperationKerberosAndPlainAuthSuite { + override def beforeAll(): Unit = { + super.beforeAll() + Thread.sleep(3000) + } + override protected val frontendProtocols: Seq[KyuubiConf.FrontendProtocols.Value] = FrontendProtocols.THRIFT_HTTP :: Nil diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/thrift/http/KyuubiOperationThriftHttpPerUserSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/thrift/http/KyuubiOperationThriftHttpPerUserSuite.scala index 8a09d8c43..d30dd94a3 100644 --- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/thrift/http/KyuubiOperationThriftHttpPerUserSuite.scala +++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/thrift/http/KyuubiOperationThriftHttpPerUserSuite.scala @@ -22,6 +22,11 @@ import org.apache.kyuubi.config.KyuubiConf.FrontendProtocols import org.apache.kyuubi.operation.KyuubiOperationPerUserSuite class KyuubiOperationThriftHttpPerUserSuite extends KyuubiOperationPerUserSuite { + override def beforeAll(): Unit = { + super.beforeAll() + Thread.sleep(3000) + } + override protected val frontendProtocols: Seq[KyuubiConf.FrontendProtocols.Value] = FrontendProtocols.THRIFT_HTTP :: Nil