This is an automated email from the ASF dual-hosted git repository.

feiwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 2b1a1f172 [KYUUBI #3685] Fix flaky test BatchRestApiSuite - basic 
batch rest client with invalid user
2b1a1f172 is described below

commit 2b1a1f17260a04419d856d9152daba520577f839
Author: Fei Wang <[email protected]>
AuthorDate: Wed Oct 26 18:53:16 2022 +0800

    [KYUUBI #3685] Fix flaky test BatchRestApiSuite - basic batch rest client 
with invalid user
    
    ### _Why are the changes needed?_
    
    <img width="1306" alt="image" 
src="https://user-images.githubusercontent.com/6757692/197462801-5327bfaf-7d8e-4cb5-bf48-9fcfd800d832.png";>
    
    Wait the connection closed after each 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.apache.org/docs/latest/develop_tools/testing.html#running-tests)
 locally before make a pull request
    
    Closes #3685 from turboFei/fix_flake.
    
    Closes #3685
    
    739051de3 [Fei Wang] wait conn closed
    1b812db76 [Fei Wang] Revert "Reorder the tests"
    1ade27744 [Fei Wang] Reorder the tests
    
    Authored-by: Fei Wang <[email protected]>
    Signed-off-by: Fei Wang <[email protected]>
---
 .../org/apache/kyuubi/server/rest/client/BatchRestApiSuite.scala   | 7 +++++++
 1 file changed, 7 insertions(+)

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 df6beb22f..c0a1343c6 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
@@ -29,6 +29,13 @@ import org.apache.kyuubi.metrics.{MetricsConstants, 
MetricsSystem}
 
 class BatchRestApiSuite extends RestClientTestHelper with BatchTestHelper {
 
+  override protected def afterEach(): Unit = {
+    eventually(timeout(5.seconds), interval(200.milliseconds)) {
+      assert(MetricsSystem.counterValue(
+        MetricsConstants.REST_CONN_OPEN).getOrElse(0L) === 0)
+    }
+  }
+
   test("basic batch rest client") {
     val basicKyuubiRestClient: KyuubiRestClient =
       KyuubiRestClient.builder(baseUri.toString)

Reply via email to