Skip to content

Commit 392ef82

Browse files
committed
tests: make PeersV2NodeRefreshIT tests close session
Unclosed session can lead to all sorts of problems. Let's close them right after test is done.
1 parent 192cd28 commit 392ef82

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

integration-tests/src/test/java/com/datastax/oss/driver/core/PeersV2NodeRefreshIT.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import com.datastax.oss.simulacron.server.BoundCluster;
3030
import com.datastax.oss.simulacron.server.Server;
3131
import java.util.concurrent.ExecutionException;
32+
import org.junit.After;
3233
import org.junit.AfterClass;
3334
import org.junit.BeforeClass;
3435
import org.junit.Test;
@@ -38,6 +39,7 @@ public class PeersV2NodeRefreshIT {
3839

3940
private static Server peersV2Server;
4041
private static BoundCluster cluster;
42+
private static CqlSession session;
4143

4244
@BeforeClass
4345
public static void setup() {
@@ -55,6 +57,13 @@ public static void tearDown() {
5557
}
5658
}
5759

60+
@After
61+
public void closeSession() {
62+
if (session != null) {
63+
session.close();
64+
}
65+
}
66+
5867
@Test
5968
public void should_successfully_send_peers_v2_node_refresh_query()
6069
throws InterruptedException, ExecutionException {

0 commit comments

Comments
 (0)