Skip to content

Commit 547bb24

Browse files
dimakrfruch
authored andcommitted
scylla-4.x: Update 4.15.0.0 and 4.17.0.0 patches
PeersV2NodeRefreshIT test is not closing its test session, which leaks into SessionLeakIT tests and causes the should_warn_when_session_count_exceeds_threshold test to fail. The change adds an After cleanup method to ensure that the test session is closed after the test and is not leaked / affecting any other subsequent tests. Fixes: #46.
1 parent 2ff7764 commit 547bb24

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

versions/scylla/4.15.0.0/patch

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
diff --git a/integration-tests/src/test/java/com/datastax/oss/driver/core/PeersV2NodeRefreshIT.java b/integration-tests/src/test/java/com/datastax/oss/driver/core/PeersV2NodeRefreshIT.java
2+
index 52a5b6eef..139d26216 100644
3+
--- a/integration-tests/src/test/java/com/datastax/oss/driver/core/PeersV2NodeRefreshIT.java
4+
+++ b/integration-tests/src/test/java/com/datastax/oss/driver/core/PeersV2NodeRefreshIT.java
5+
@@ -27,6 +27,7 @@ import com.datastax.oss.simulacron.common.cluster.QueryLog;
6+
import com.datastax.oss.simulacron.server.BoundCluster;
7+
import com.datastax.oss.simulacron.server.Server;
8+
import java.util.concurrent.ExecutionException;
9+
+import org.junit.After;
10+
import org.junit.AfterClass;
11+
import org.junit.BeforeClass;
12+
import org.junit.Test;
13+
@@ -36,6 +37,7 @@ public class PeersV2NodeRefreshIT {
14+
15+
private static Server peersV2Server;
16+
private static BoundCluster cluster;
17+
+ private static CqlSession session;
18+
19+
@BeforeClass
20+
public static void setup() {
21+
@@ -53,11 +55,17 @@ public class PeersV2NodeRefreshIT {
22+
}
23+
}
24+
25+
+ @After
26+
+ public void closeSession() {
27+
+ if (session != null) {
28+
+ session.close();
29+
+ }
30+
+ }
31+
+
32+
@Test
33+
public void should_successfully_send_peers_v2_node_refresh_query()
34+
throws InterruptedException, ExecutionException {
35+
- CqlSession session =
36+
- CqlSession.builder().addContactPoint(cluster.node(1).inetSocketAddress()).build();
37+
+ session = CqlSession.builder().addContactPoint(cluster.node(1).inetSocketAddress()).build();
38+
Node node = findNonControlNode(session);
39+
((InternalDriverContext) session.getContext())
40+
.getMetadataManager()
141
diff --git a/test-infra/src/main/java/com/datastax/oss/driver/api/testinfra/ccm/BaseCcmRule.java b/test-infra/src/main/java/com/datastax/oss/driver/api/testinfra/ccm/BaseCcmRule.java
242
index bb8d0b46d..02ee625cc 100644
343
--- a/test-infra/src/main/java/com/datastax/oss/driver/api/testinfra/ccm/BaseCcmRule.java

versions/scylla/4.17.0.0/patch

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
diff --git a/integration-tests/src/test/java/com/datastax/oss/driver/core/PeersV2NodeRefreshIT.java b/integration-tests/src/test/java/com/datastax/oss/driver/core/PeersV2NodeRefreshIT.java
2+
index 52a5b6eef..139d26216 100644
3+
--- a/integration-tests/src/test/java/com/datastax/oss/driver/core/PeersV2NodeRefreshIT.java
4+
+++ b/integration-tests/src/test/java/com/datastax/oss/driver/core/PeersV2NodeRefreshIT.java
5+
@@ -27,6 +27,7 @@ import com.datastax.oss.simulacron.common.cluster.QueryLog;
6+
import com.datastax.oss.simulacron.server.BoundCluster;
7+
import com.datastax.oss.simulacron.server.Server;
8+
import java.util.concurrent.ExecutionException;
9+
+import org.junit.After;
10+
import org.junit.AfterClass;
11+
import org.junit.BeforeClass;
12+
import org.junit.Test;
13+
@@ -36,6 +37,7 @@ public class PeersV2NodeRefreshIT {
14+
15+
private static Server peersV2Server;
16+
private static BoundCluster cluster;
17+
+ private static CqlSession session;
18+
19+
@BeforeClass
20+
public static void setup() {
21+
@@ -53,11 +55,17 @@ public class PeersV2NodeRefreshIT {
22+
}
23+
}
24+
25+
+ @After
26+
+ public void closeSession() {
27+
+ if (session != null) {
28+
+ session.close();
29+
+ }
30+
+ }
31+
+
32+
@Test
33+
public void should_successfully_send_peers_v2_node_refresh_query()
34+
throws InterruptedException, ExecutionException {
35+
- CqlSession session =
36+
- CqlSession.builder().addContactPoint(cluster.node(1).inetSocketAddress()).build();
37+
+ session = CqlSession.builder().addContactPoint(cluster.node(1).inetSocketAddress()).build();
38+
Node node = findNonControlNode(session);
39+
((InternalDriverContext) session.getContext())
40+
.getMetadataManager()
141
diff --git a/test-infra/src/main/java/com/datastax/oss/driver/api/testinfra/ccm/BaseCcmRule.java b/test-infra/src/main/java/com/datastax/oss/driver/api/testinfra/ccm/BaseCcmRule.java
242
index 8537c89f8..6207e2df1 100644
343
--- a/test-infra/src/main/java/com/datastax/oss/driver/api/testinfra/ccm/BaseCcmRule.java

0 commit comments

Comments
 (0)