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

mpochatkin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new 20f1e002ed IGNITE-22357 Some integration tests don't close the client 
(#3832)
20f1e002ed is described below

commit 20f1e002ed8b6961d9acf0c5054a1d720499c53f
Author: Vadim Pakhnushev <[email protected]>
AuthorDate: Wed May 29 14:51:54 2024 +0300

    IGNITE-22357 Some integration tests don't close the client (#3832)
---
 .../internal/table/ItTablePutGetThinTest.java      | 22 +++++++++++++++++-----
 .../ItThinClientPartitionManagerTest.java          |  6 ++++++
 2 files changed, 23 insertions(+), 5 deletions(-)

diff --git 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItTablePutGetThinTest.java
 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItTablePutGetThinTest.java
index d19ac8fbb3..79181abaab 100644
--- 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItTablePutGetThinTest.java
+++ 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItTablePutGetThinTest.java
@@ -19,17 +19,29 @@ package org.apache.ignite.internal.table;
 
 import org.apache.ignite.client.IgniteClient;
 import org.apache.ignite.table.manager.IgniteTables;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
 
 /**
  * Tests to check that rows can be inserted and retrieved through thin client.
  */
 public class ItTablePutGetThinTest extends ItTablePutGetEmbeddedTest {
+    private static IgniteClient client;
+
+    @BeforeAll
+    static void startClient() {
+        client = IgniteClient.builder()
+                .addresses("127.0.0.1:10800")
+                .build();
+    }
+
+    @AfterAll
+    static void stopClient() throws Exception {
+        client.close();
+    }
+
     @Override
-    @SuppressWarnings("resource")
     IgniteTables tables() {
-        return IgniteClient.builder()
-                .addresses("127.0.0.1:10800")
-                .build()
-                .tables();
+        return client.tables();
     }
 }
diff --git 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/partition/ItThinClientPartitionManagerTest.java
 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/partition/ItThinClientPartitionManagerTest.java
index 6a08ffdb7b..8299185dac 100644
--- 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/partition/ItThinClientPartitionManagerTest.java
+++ 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/partition/ItThinClientPartitionManagerTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.table.partition;
 
 import org.apache.ignite.client.IgniteClient;
 import org.apache.ignite.table.partition.PartitionManager;
+import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 
 /**
@@ -35,6 +36,11 @@ public class ItThinClientPartitionManagerTest extends 
ItAbstractPartitionManager
                 .build();
     }
 
+    @AfterEach
+    public void stopClient() throws Exception {
+        client.close();
+    }
+
     @Override
     protected PartitionManager partitionManager() {
         return client.tables().table(TABLE_NAME).partitionManager();

Reply via email to