Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
pan3793 committed Sep 7, 2022
1 parent 840205e commit fd8f797
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ class FlinkOperationSuite extends WithKyuubiServerAndFlinkMiniCluster
}

test("server info provider - server") {
withSessionConf(Map(KyuubiConf.SERVER_INFO_PROVIDER.key -> "SERVER"))()() {
withSessionConf(Map(
KyuubiConf.SESSION_ENGINE_LAUNCH_ASYNC.key -> "false",
KyuubiConf.SERVER_INFO_PROVIDER.key -> "SERVER"))()() {
withSessionHandle { (client, handle) =>
val req = new TGetInfoReq()
req.setSessionHandle(handle)
Expand All @@ -84,7 +86,9 @@ class FlinkOperationSuite extends WithKyuubiServerAndFlinkMiniCluster
}

test("server info provider - engine") {
withSessionConf(Map(KyuubiConf.SERVER_INFO_PROVIDER.key -> "ENGINE"))()() {
withSessionConf(Map(
KyuubiConf.SESSION_ENGINE_LAUNCH_ASYNC.key -> "false",
KyuubiConf.SERVER_INFO_PROVIDER.key -> "ENGINE"))()() {
withSessionHandle { (client, handle) =>
val req = new TGetInfoReq()
req.setSessionHandle(handle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ class KyuubiOperationHiveEnginePerUserSuite extends WithKyuubiServer with HiveEn
override protected def jdbcUrl: String = getJdbcUrl

test("server info provider - server") {
withSessionConf(Map(KyuubiConf.SERVER_INFO_PROVIDER.key -> "SERVER"))()() {
withSessionConf(Map(
KyuubiConf.SESSION_ENGINE_LAUNCH_ASYNC.key -> "false",
KyuubiConf.SERVER_INFO_PROVIDER.key -> "SERVER"))()() {
withSessionHandle { (client, handle) =>
val req = new TGetInfoReq()
req.setSessionHandle(handle)
Expand All @@ -52,7 +54,9 @@ class KyuubiOperationHiveEnginePerUserSuite extends WithKyuubiServer with HiveEn
}

test("server info provider - engine") {
withSessionConf(Map(KyuubiConf.SERVER_INFO_PROVIDER.key -> "ENGINE"))()() {
withSessionConf(Map(
KyuubiConf.SESSION_ENGINE_LAUNCH_ASYNC.key -> "false",
KyuubiConf.SERVER_INFO_PROVIDER.key -> "ENGINE"))()() {
withSessionHandle { (client, handle) =>
val req = new TGetInfoReq()
req.setSessionHandle(handle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ class KyuubiSessionImpl(
}

override def getInfo(infoType: TGetInfoType): TGetInfoValue = {
val serverConf = sessionManager.getConf
val provider = serverConf.get(SERVER_INFO_PROVIDER)
val provider = sessionConf.get(SERVER_INFO_PROVIDER)

if (client == null) {
if (provider != "SERVER") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ class KyuubiOperationPerConnectionSuite extends WithKyuubiServer with HiveJDBCTe
}

test("transfer the TGetInfoReq to kyuubi engine side to verify the connection valid") {
withSessionConf(Map.empty)(Map(KyuubiConf.SESSION_ENGINE_LAUNCH_ASYNC.key -> "false"))() {
withSessionConf(Map.empty)(Map(
KyuubiConf.SERVER_INFO_PROVIDER.key -> "ENGINE",
KyuubiConf.SESSION_ENGINE_LAUNCH_ASYNC.key -> "false"))() {
withJdbcStatement() { statement =>
val conn = statement.getConnection.asInstanceOf[KyuubiConnection]
assert(conn.isValid(3000))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@ class KyuubiOperationPerUserSuite
}

test("server info provider - server") {
withSessionConf(Map(KyuubiConf.SERVER_INFO_PROVIDER.key -> "SERVER"))()() {
withSessionConf(Map(
KyuubiConf.SERVER_INFO_PROVIDER.key -> "SERVER",
KyuubiConf.SESSION_ENGINE_LAUNCH_ASYNC.key -> "false"))()() {
withSessionHandle { (client, handle) =>
val req = new TGetInfoReq()
req.setSessionHandle(handle)
Expand All @@ -256,7 +258,9 @@ class KyuubiOperationPerUserSuite
}

test("server info provider - engine") {
withSessionConf(Map(KyuubiConf.SERVER_INFO_PROVIDER.key -> "ENGINE"))()() {
withSessionConf(Map(
KyuubiConf.SERVER_INFO_PROVIDER.key -> "ENGINE",
KyuubiConf.SESSION_ENGINE_LAUNCH_ASYNC.key -> "false"))()() {
withSessionHandle { (client, handle) =>
val req = new TGetInfoReq()
req.setSessionHandle(handle)
Expand Down

0 comments on commit fd8f797

Please sign in to comment.