Skip to content

Commit 79ef1b5

Browse files
committed
flaky test
1 parent f822285 commit 79ef1b5

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

kyuubi-server/src/test/scala/org/apache/kyuubi/events/handler/ServerJsonLoggingEventHandlerSuite.scala

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import com.fasterxml.jackson.databind.ObjectMapper
2828
import org.apache.hadoop.conf.Configuration
2929
import org.apache.hadoop.fs.{FileSystem, Path}
3030
import org.apache.hive.service.rpc.thrift.{TOpenSessionReq, TStatusCode}
31+
import org.scalatest.time.SpanSugar.convertIntToGrainOfTime
3132

3233
import org.apache.kyuubi._
3334
import 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

Comments
 (0)