Skip to content

Commit

Permalink
add todo
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopamaral committed Oct 7, 2024
1 parent 3a3ba16 commit 60ce55e
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,23 +193,27 @@ class KyuubiOperationYarnClusterSuite extends WithKyuubiServerOnYarn with HiveJD
}

test("fast fail the kyuubi connection on engine terminated") {
val batchId = UUID.randomUUID().toString
withSessionConf(Map.empty)(Map(
"spark.master" -> "yarn",
"spark.submit.deployMode" -> "cluster",
"spark.sql.defaultCatalog=spark_catalog" -> "spark_catalog",
"spark.sql.catalog.spark_catalog.type" -> "invalid_type",
ENGINE_INIT_TIMEOUT.key -> "PT10M",
KYUUBI_BATCH_ID_KEY -> batchId))(Map.empty) {
KYUUBI_BATCH_ID_KEY -> UUID.randomUUID().toString))(Map.empty) {
val startTime = System.currentTimeMillis()
val exception = intercept[Exception] {
withJdbcStatement() { _ => }
}
val elapsedTime = System.currentTimeMillis() - startTime
assert(elapsedTime < 60 * 1000)
assert(exception.getMessage contains "Could not open client transport with JDBC Uri")
assert(sessionManager.getBatchMetadata(batchId).map(_.state).contains("ERROR"))
assert(sessionManager.getBatchMetadata(batchId).map(_.appState).contains("UNKNOWN"))
}
}

test("last application state is UNKNOWN if engine connection fail") {
val batchId = UUID.randomUUID().toString
// TODO Simulate connection fail
assert(sessionManager.getBatchMetadata(batchId).map(_.state).contains("ERROR"))
assert(sessionManager.getBatchMetadata(batchId).map(_.appState).contains("UNKNOWN"))
}
}

0 comments on commit 60ce55e

Please sign in to comment.