Skip to content

Commit ac39712

Browse files
Bouncheckfruch
authored andcommitted
Rebase 3.11.4.0 patch on top of 3.11.2.4 patch
Order of operations: checkout driver 3.11.4.0, apply 3.11.2.4 patch, apply old 3.11.4.0 patch, generate the new patch file and replace 3.11.4.0 patch file. All patches applied cleanly.
1 parent aa572d8 commit ac39712

File tree

2 files changed

+266
-1
lines changed

2 files changed

+266
-1
lines changed
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
tests:
2-
-
2+
# test count on tracing which it's content is different in scylla, should be skipped on scylla
3+
- PreparedStatementTest #should_create_tombstone_when_null_value_on_bound_statement
4+
5+
# disable cause now CCM uses different ip address and port for the JMX
6+
- CCMBridgeTest
7+
8+
# using 2 node cluster, and stopping one, isn't supported by scylla since raft
9+
- SchemaChangesCCTest #should_receive_changes_made_while_control_connection_is_down_on_reconnect
10+
11+
# as ScyllaSkip mark doesn't seem to function correctly (skipping, but then failing the test again anyway)
12+
# the class is disabled due to unsupported options used for Scylla (should_keep_reconnecting_on_authentication_error)
13+
- ReconnectionTest

versions/scylla/3.11.4.0/patch

Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,179 @@
1+
diff --git a/driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java b/driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
2+
index 4c9ba61fc5..3d0f4fa946 100644
3+
--- a/driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
4+
+++ b/driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
5+
@@ -206,7 +206,7 @@ public class CCMBridge implements CCMAccess {
6+
installArgs.add("-v git:" + branch.trim().replaceAll("\"", ""));
7+
} else if (inputScyllaVersion != null && !inputScyllaVersion.trim().isEmpty()) {
8+
installArgs.add(" --scylla ");
9+
- installArgs.add("-v release:" + inputScyllaVersion);
10+
+ installArgs.add("-v " + inputScyllaVersion);
11+
12+
// Detect Scylla Enterprise - it should start with
13+
// a 4-digit year.
14+
@@ -246,7 +246,8 @@ public class CCMBridge implements CCMAccess {
15+
}
16+
ENVIRONMENT_MAP = ImmutableMap.copyOf(envMap);
17+
18+
- GLOBAL_SCYLLA_VERSION_NUMBER = VersionNumber.parse(inputScyllaVersion);
19+
+ GLOBAL_SCYLLA_VERSION_NUMBER =
20+
+ VersionNumber.parse("5.2"); // VersionNumber.parse(inputScyllaVersion);
21+
22+
if (isDse()) {
23+
GLOBAL_DSE_VERSION_NUMBER = VersionNumber.parse(inputCassandraVersion);
24+
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ClusterStressTest.java b/driver-core/src/test/java/com/datastax/driver/core/ClusterStressTest.java
25+
index 74befba297..e5867e5067 100644
26+
--- a/driver-core/src/test/java/com/datastax/driver/core/ClusterStressTest.java
27+
+++ b/driver-core/src/test/java/com/datastax/driver/core/ClusterStressTest.java
28+
@@ -35,6 +35,7 @@ import org.slf4j.LoggerFactory;
29+
import org.testng.annotations.AfterMethod;
30+
import org.testng.annotations.Test;
31+
32+
+@CCMConfig(jvmArgs = {"--smp", "1"})
33+
public class ClusterStressTest extends CCMTestsSupport {
34+
35+
private static final Logger logger = LoggerFactory.getLogger(ClusterStressTest.class);
36+
diff --git a/driver-core/src/test/java/com/datastax/driver/core/HostConnectionPoolTest.java b/driver-core/src/test/java/com/datastax/driver/core/HostConnectionPoolTest.java
37+
index f44e64dca0..aed5e394c6 100644
38+
--- a/driver-core/src/test/java/com/datastax/driver/core/HostConnectionPoolTest.java
39+
+++ b/driver-core/src/test/java/com/datastax/driver/core/HostConnectionPoolTest.java
40+
@@ -597,7 +597,7 @@ public class HostConnectionPoolTest extends ScassandraTestBase.PerClassCluster {
41+
allRequests.addAll(requests);
42+
allRequests.add(MockRequest.send(pool));
43+
44+
- verify(factory, after(2000).times(1)).open(any(HostConnectionPool.class));
45+
+ verify(factory, after(2000).times(1)).open(any(HostConnectionPool.class), anyInt(), anyInt());
46+
assertPoolSize(pool, 2);
47+
Connection connection2 = pool.connections[0].get(1);
48+
49+
@@ -625,7 +625,7 @@ public class HostConnectionPoolTest extends ScassandraTestBase.PerClassCluster {
50+
51+
// Borrowing one more time should resurrect the trashed connection
52+
allRequests.addAll(MockRequest.sendMany(1, pool));
53+
- verify(factory, after(2000).times(1)).open(any(HostConnectionPool.class));
54+
+ verify(factory, after(2000).times(1)).open(any(HostConnectionPool.class), anyInt(), anyInt());
55+
assertPoolSize(pool, 2);
56+
57+
assertThat(pool.connections[0]).containsExactly(connection2, connection1);
58+
@@ -664,7 +664,7 @@ public class HostConnectionPoolTest extends ScassandraTestBase.PerClassCluster {
59+
allRequests.addAll(requests);
60+
allRequests.add(MockRequest.send(pool));
61+
62+
- verify(factory, after(2000).times(1)).open(any(HostConnectionPool.class));
63+
+ verify(factory, after(2000).times(1)).open(any(HostConnectionPool.class), anyInt(), anyInt());
64+
assertPoolSize(pool, 2);
65+
reset(factory);
66+
Connection connection2 = pool.connections[0].get(1);
67+
@@ -699,7 +699,7 @@ public class HostConnectionPoolTest extends ScassandraTestBase.PerClassCluster {
68+
allRequests.addAll(requests);
69+
allRequests.add(MockRequest.send(pool));
70+
assertThat(connection2.inFlight.get()).isEqualTo(101);
71+
- verify(factory, after(2000).times(1)).open(any(HostConnectionPool.class));
72+
+ verify(factory, after(2000).times(1)).open(any(HostConnectionPool.class), anyInt(), anyInt());
73+
assertPoolSize(pool, 2);
74+
75+
// Borrow again to get the new connection
76+
@@ -742,7 +742,7 @@ public class HostConnectionPoolTest extends ScassandraTestBase.PerClassCluster {
77+
allRequests.addAll(requests);
78+
allRequests.add(MockRequest.send(pool));
79+
80+
- verify(factory, after(2000).times(1)).open(any(HostConnectionPool.class));
81+
+ verify(factory, after(2000).times(1)).open(any(HostConnectionPool.class), anyInt(), anyInt());
82+
assertThat(pool.connections[0]).hasSize(2);
83+
84+
// Return enough times to get back under the threshold where one connection is enough
85+
@@ -988,7 +988,7 @@ public class HostConnectionPoolTest extends ScassandraTestBase.PerClassCluster {
86+
87+
// Should not have tried to create a new core connection since reconnection time had not
88+
// elapsed.
89+
- verify(factory, never()).open(any(HostConnectionPool.class));
90+
+ verify(factory, never()).open(any(HostConnectionPool.class), anyInt(), anyInt());
91+
92+
// Sleep to elapse the Reconnection Policy.
93+
Uninterruptibles.sleepUninterruptibly(reconnectInterval, TimeUnit.MILLISECONDS);
94+
@@ -1003,7 +1003,7 @@ public class HostConnectionPoolTest extends ScassandraTestBase.PerClassCluster {
95+
// Should have tried to open up to core connections as result of borrowing a connection past
96+
// reconnect time and not being at core.
97+
blockingExecutor.blockUntilNextTaskCompleted();
98+
- verify(factory).open(any(HostConnectionPool.class));
99+
+ verify(factory).open(any(HostConnectionPool.class), anyInt(), anyInt());
100+
reset(factory);
101+
102+
// Sleep for reconnect interval to allow reconnection time to elapse.
103+
@@ -1019,7 +1019,7 @@ public class HostConnectionPoolTest extends ScassandraTestBase.PerClassCluster {
104+
blockingExecutor.reset();
105+
allRequests.add(MockRequest.send(pool));
106+
blockingExecutor.blockUntilNextTaskCompleted();
107+
- verify(factory).open(any(HostConnectionPool.class));
108+
+ verify(factory).open(any(HostConnectionPool.class), anyInt(), anyInt());
109+
reset(factory);
110+
111+
// Another core connection should be opened as result of another request to get us up to core
112+
@@ -1027,14 +1027,14 @@ public class HostConnectionPoolTest extends ScassandraTestBase.PerClassCluster {
113+
blockingExecutor.reset();
114+
allRequests.add(MockRequest.send(pool));
115+
blockingExecutor.blockUntilNextTaskCompleted();
116+
- verify(factory).open(any(HostConnectionPool.class));
117+
+ verify(factory).open(any(HostConnectionPool.class), anyInt(), anyInt());
118+
reset(factory);
119+
120+
// Sending another request should not grow the pool any more, since we are now at core
121+
// connections.
122+
allRequests.add(MockRequest.send(pool));
123+
verify(factory, after((reconnectInterval + readTimeout) * 2).never())
124+
- .open(any(HostConnectionPool.class));
125+
+ .open(any(HostConnectionPool.class), anyInt(), anyInt());
126+
} finally {
127+
MockRequest.completeAll(allRequests);
128+
cluster.close();
129+
@@ -1082,7 +1082,7 @@ public class HostConnectionPoolTest extends ScassandraTestBase.PerClassCluster {
130+
}
131+
132+
// Pool should grow by 1.
133+
- verify(factory, after(2000).times(1)).open(any(HostConnectionPool.class));
134+
+ verify(factory, after(2000).times(1)).open(any(HostConnectionPool.class), anyInt(), anyInt());
135+
assertThat(pool.connections[0]).hasSize(2);
136+
137+
// Reset factory mock as we'll be checking for new open() invokes later.
138+
@@ -1110,7 +1110,8 @@ public class HostConnectionPoolTest extends ScassandraTestBase.PerClassCluster {
139+
assertThat(pool.connections[0]).hasSize(1);
140+
141+
// A new connection should never have been spawned since we didn't max out core.
142+
- verify(factory, after(readTimeout).never()).open(any(HostConnectionPool.class));
143+
+ verify(factory, after(readTimeout).never())
144+
+ .open(any(HostConnectionPool.class), anyInt(), anyInt());
145+
146+
// Borrow another connection, since we exceed max another connection should be opened.
147+
MockRequest request = MockRequest.send(pool);
148+
@@ -1118,7 +1119,7 @@ public class HostConnectionPoolTest extends ScassandraTestBase.PerClassCluster {
149+
assertThat(request.getConnection()).isEqualTo(extra1);
150+
151+
// After some time the a connection should attempt to be opened (but will fail).
152+
- verify(factory, timeout(readTimeout)).open(any(HostConnectionPool.class));
153+
+ verify(factory, timeout(readTimeout)).open(any(HostConnectionPool.class), anyInt(), anyInt());
154+
assertPoolSize(pool, 1);
155+
assertThat(pool.connections[0]).hasSize(1);
156+
157+
@@ -1314,7 +1315,8 @@ public class HostConnectionPoolTest extends ScassandraTestBase.PerClassCluster {
158+
MockRequest request = MockRequest.send(pool, 1);
159+
160+
// Should create up to core connections.
161+
- verify(factory, timeout(readTimeout * 8).times(8)).open(any(HostConnectionPool.class));
162+
+ verify(factory, timeout(readTimeout * 8).times(8))
163+
+ .open(any(HostConnectionPool.class), anyInt(), anyInt());
164+
assertPoolSize(pool, 8);
165+
166+
request.simulateSuccessResponse();
167+
@@ -1365,7 +1367,8 @@ public class HostConnectionPoolTest extends ScassandraTestBase.PerClassCluster {
168+
MockRequest request = MockRequest.send(pool, 1);
169+
170+
// Should create up to core connections.
171+
- verify(factory, timeout(readTimeout).times(1)).open(any(HostConnectionPool.class));
172+
+ verify(factory, timeout(readTimeout).times(1))
173+
+ .open(any(HostConnectionPool.class), anyInt(), anyInt());
174+
assertPoolSize(pool, 1);
175+
Uninterruptibles.getUninterruptibly(request.requestInitialized, 10, TimeUnit.SECONDS);
176+
request.simulateSuccessResponse();
1177
diff --git a/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java b/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java
2178
index 09f8bf8edb..4f01cb47a6 100644
3179
--- a/driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java
@@ -20,3 +196,81 @@ index 09f8bf8edb..4f01cb47a6 100644
20196

21197
try {
22198
cluster.init();
199+
diff --git a/driver-core/src/test/java/com/datastax/driver/core/NettyOptionsTest.java b/driver-core/src/test/java/com/datastax/driver/core/NettyOptionsTest.java
200+
index fbdf187a70..dd1c345929 100644
201+
--- a/driver-core/src/test/java/com/datastax/driver/core/NettyOptionsTest.java
202+
+++ b/driver-core/src/test/java/com/datastax/driver/core/NettyOptionsTest.java
203+
@@ -45,7 +45,9 @@ import org.mockito.stubbing.Answer;
204+
import org.testng.annotations.Test;
205+
206+
@CreateCCM(PER_METHOD)
207+
-@CCMConfig(createCluster = false)
208+
+@CCMConfig(
209+
+ createCluster = false,
210+
+ jvmArgs = {"--smp", "1"})
211+
public class NettyOptionsTest extends CCMTestsSupport {
212+
213+
@Test(groups = "short")
214+
diff --git a/driver-core/src/test/java/com/datastax/driver/core/ReconnectionTest.java b/driver-core/src/test/java/com/datastax/driver/core/ReconnectionTest.java
215+
index b3d6be0f3c..30fafa5273 100644
216+
--- a/driver-core/src/test/java/com/datastax/driver/core/ReconnectionTest.java
217+
+++ b/driver-core/src/test/java/com/datastax/driver/core/ReconnectionTest.java
218+
@@ -24,6 +24,7 @@ package com.datastax.driver.core;
219+
import static com.datastax.driver.core.Assertions.assertThat;
220+
import static com.datastax.driver.core.CreateCCM.TestMode.PER_METHOD;
221+
import static java.util.concurrent.TimeUnit.SECONDS;
222+
+import static org.assertj.core.api.Assertions.assertThat;
223+
import static org.mockito.Mockito.reset;
224+
import static org.mockito.Mockito.spy;
225+
import static org.mockito.Mockito.times;
226+
@@ -218,7 +219,10 @@ public class ReconnectionTest extends CCMTestsSupport {
227+
* The connection established by a successful reconnection attempt should be reused in one of the
228+
* connection pools (JAVA-505).
229+
*/
230+
- @CCMConfig(dirtiesContext = true, createCluster = false)
231+
+ @CCMConfig(
232+
+ dirtiesContext = true,
233+
+ createCluster = false,
234+
+ jvmArgs = {"--smp", "1"})
235+
@Test(groups = "long")
236+
public void should_use_connection_from_reconnection_in_pool() {
237+
TogglabePolicy loadBalancingPolicy = new TogglabePolicy(new RoundRobinPolicy());
238+
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SessionLeakTest.java b/driver-core/src/test/java/com/datastax/driver/core/SessionLeakTest.java
239+
index aa0f573795..6eaa74e318 100644
240+
--- a/driver-core/src/test/java/com/datastax/driver/core/SessionLeakTest.java
241+
+++ b/driver-core/src/test/java/com/datastax/driver/core/SessionLeakTest.java
242+
@@ -19,6 +19,7 @@ import static com.datastax.driver.core.Assertions.assertThat;
243+
import static com.datastax.driver.core.CreateCCM.TestMode.PER_METHOD;
244+
import static com.google.common.collect.Lists.newArrayList;
245+
import static java.util.concurrent.TimeUnit.MINUTES;
246+
+import static org.assertj.core.api.Assertions.assertThat;
247+
import static org.assertj.core.api.Assertions.fail;
248+
249+
import com.datastax.driver.core.exceptions.InvalidQueryException;
250+
@@ -27,7 +28,10 @@ import java.util.concurrent.TimeUnit;
251+
import org.testng.annotations.Test;
252+
253+
@CreateCCM(PER_METHOD)
254+
-@CCMConfig(dirtiesContext = true, createCluster = false)
255+
+@CCMConfig(
256+
+ dirtiesContext = true,
257+
+ createCluster = false,
258+
+ jvmArgs = {"--smp", "1"})
259+
public class SessionLeakTest extends CCMTestsSupport {
260+
261+
SocketChannelMonitor channelMonitor;
262+
diff --git a/driver-core/src/test/java/com/datastax/driver/core/SessionStressTest.java b/driver-core/src/test/java/com/datastax/driver/core/SessionStressTest.java
263+
index ea75f84544..ea70e9081a 100644
264+
--- a/driver-core/src/test/java/com/datastax/driver/core/SessionStressTest.java
265+
+++ b/driver-core/src/test/java/com/datastax/driver/core/SessionStressTest.java
266+
@@ -38,7 +38,9 @@ import org.slf4j.LoggerFactory;
267+
import org.testng.annotations.AfterMethod;
268+
import org.testng.annotations.Test;
269+
270+
-@CCMConfig(dirtiesContext = true)
271+
+@CCMConfig(
272+
+ dirtiesContext = true,
273+
+ jvmArgs = {"--smp", "1", "--max-networking-io-control-blocks", "15000"})
274+
public class SessionStressTest extends CCMTestsSupport {
275+
276+
private static final Logger logger = LoggerFactory.getLogger(SessionStressTest.class);

0 commit comments

Comments
 (0)