Skip to content

Commit 60ce55e

Browse files
committed
add todo
1 parent 3a3ba16 commit 60ce55e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

kyuubi-server/src/test/scala/org/apache/kyuubi/WithKyuubiServerOnYarn.scala

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,23 +193,27 @@ class KyuubiOperationYarnClusterSuite extends WithKyuubiServerOnYarn with HiveJD
193193
}
194194

195195
test("fast fail the kyuubi connection on engine terminated") {
196-
val batchId = UUID.randomUUID().toString
197196
withSessionConf(Map.empty)(Map(
198197
"spark.master" -> "yarn",
199198
"spark.submit.deployMode" -> "cluster",
200199
"spark.sql.defaultCatalog=spark_catalog" -> "spark_catalog",
201200
"spark.sql.catalog.spark_catalog.type" -> "invalid_type",
202201
ENGINE_INIT_TIMEOUT.key -> "PT10M",
203-
KYUUBI_BATCH_ID_KEY -> batchId))(Map.empty) {
202+
KYUUBI_BATCH_ID_KEY -> UUID.randomUUID().toString))(Map.empty) {
204203
val startTime = System.currentTimeMillis()
205204
val exception = intercept[Exception] {
206205
withJdbcStatement() { _ => }
207206
}
208207
val elapsedTime = System.currentTimeMillis() - startTime
209208
assert(elapsedTime < 60 * 1000)
210209
assert(exception.getMessage contains "Could not open client transport with JDBC Uri")
211-
assert(sessionManager.getBatchMetadata(batchId).map(_.state).contains("ERROR"))
212-
assert(sessionManager.getBatchMetadata(batchId).map(_.appState).contains("UNKNOWN"))
213210
}
214211
}
212+
213+
test("last application state is UNKNOWN if engine connection fail") {
214+
val batchId = UUID.randomUUID().toString
215+
// TODO Simulate connection fail
216+
assert(sessionManager.getBatchMetadata(batchId).map(_.state).contains("ERROR"))
217+
assert(sessionManager.getBatchMetadata(batchId).map(_.appState).contains("UNKNOWN"))
218+
}
215219
}

0 commit comments

Comments
 (0)