From c2e861bbfbcc1367a92bc02676edb995c5a77917 Mon Sep 17 00:00:00 2001 From: Cheng Pan Date: Sun, 25 Jun 2023 10:41:28 +0800 Subject: [PATCH] [KYUUBI #4978][FOLLOWUP] Fix flaky test: close expired operations ### _Why are the changes needed?_ The assertions are fragile because the session only has 5s as the idle timeout. ``` assert(lastAccessTime === session.lastAccessTime) assert(sessionManager.getOpenSessionCount === 1) ``` https://github.com/apache/kyuubi/actions/runs/5312620487/jobs/9617377736?pr=4980 ``` - close expired operations *** FAILED *** 0 did not equal 1 (TFrontendServiceSuite.scala:544) ``` ### _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/contributing/code/testing.html#running-tests) locally before make a pull request Closes #4987 from pan3793/flaytest. Closes #4978 3feacafe1 [Cheng Pan] nit 317f04576 [Cheng Pan] [KYUUBI #4978][FOLLOWUP] Fix flaky test: close expired operations Authored-by: Cheng Pan Signed-off-by: Cheng Pan --- .../org/apache/kyuubi/service/TFrontendServiceSuite.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/service/TFrontendServiceSuite.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/service/TFrontendServiceSuite.scala index 91bd3a264..914388b99 100644 --- a/kyuubi-common/src/test/scala/org/apache/kyuubi/service/TFrontendServiceSuite.scala +++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/service/TFrontendServiceSuite.scala @@ -538,14 +538,12 @@ class TFrontendServiceSuite extends KyuubiFunSuite { eventually(timeout(Span(60, Seconds)), interval(Span(1, Seconds))) { assert(lastAccessTime <= session.lastIdleTime) } - info("operation is terminated") - assert(lastAccessTime === session.lastAccessTime) - assert(sessionManager.getOpenSessionCount === 1) eventually(timeout(Span(60, Seconds)), interval(Span(1, Seconds))) { assert(session.lastAccessTime > lastAccessTime) } + info("session is terminated") assert(sessionManager.getOpenSessionCount === 0) } }