@@ -28,6 +28,7 @@ import com.fasterxml.jackson.databind.ObjectMapper
2828import org .apache .hadoop .conf .Configuration
2929import org .apache .hadoop .fs .{FileSystem , Path }
3030import org .apache .hive .service .rpc .thrift .{TOpenSessionReq , TStatusCode }
31+ import org .scalatest .time .SpanSugar .convertIntToGrainOfTime
3132
3233import org .apache .kyuubi ._
3334import org .apache .kyuubi .config .KyuubiConf
@@ -277,15 +278,17 @@ class ServerJsonLoggingEventHandlerSuite extends WithKyuubiServer with HiveJDBCT
277278 }
278279 }
279280
280- val serverSessionEventPath =
281- Paths .get(serverLogRoot, " kyuubi_session" , s " day= $currentDate" )
282- withJdbcStatement() { statement =>
283- val res = statement.executeQuery(
284- s " SELECT * FROM `json`.` $serverSessionEventPath` " +
285- s " where sessionName = ' $name' and exception is not null limit 1 " )
286- assert(res.next())
287- val exception = res.getObject(" exception" )
288- assert(exception.toString.contains(" Invalid maximum heap size: -Xmxabc" ))
281+ eventually(timeout(2 .minutes), interval(10 .seconds)) {
282+ val serverSessionEventPath =
283+ Paths .get(serverLogRoot, " kyuubi_session" , s " day= $currentDate" )
284+ withJdbcStatement() { statement =>
285+ val res = statement.executeQuery(
286+ s " SELECT * FROM `json`.` $serverSessionEventPath` " +
287+ s " where sessionName = ' $name' and exception is not null limit 1 " )
288+ assert(res.next())
289+ val exception = res.getObject(" exception" )
290+ assert(exception.toString.contains(" Invalid maximum heap size: -Xmxabc" ))
291+ }
289292 }
290293 }
291294}
0 commit comments