From b8ee006ca4181406c7effdb8868597e7febbf46a Mon Sep 17 00:00:00 2001 From: fwang12 Date: Wed, 17 May 2023 10:42:42 +0800 Subject: [PATCH] [KYUUBI #4807][FOLLOWUP] Fix flaky test "basic batch rest client" ### _Why are the changes needed?_ Using `eventually` to fix the flaky test. ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [x] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request Closes #4845 from turboFei/flaky_test_log. Closes #4807 3f11bb048 [fwang12] Fix flaky test - basic batch rest client Authored-by: fwang12 Signed-off-by: fwang12 --- .../kyuubi/server/rest/client/BatchRestApiSuite.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/BatchRestApiSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/BatchRestApiSuite.scala index ef53fbe3e..d04826a9d 100644 --- a/kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/BatchRestApiSuite.scala +++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/BatchRestApiSuite.scala @@ -68,8 +68,10 @@ class BatchRestApiSuite extends RestClientTestHelper with BatchTestHelper { assert(batch.getBatchType === "SPARK") // get batch log - val log = batchRestApi.getBatchLocalLog(batch.getId(), 0, 1) - assert(log.getRowCount == 1) + eventually(timeout(1.minutes)) { + val log = batchRestApi.getBatchLocalLog(batch.getId(), 0, 1) + assert(log.getRowCount == 1) + } // delete batch val closeResp = batchRestApi.deleteBatch(batch.getId(), null)