Elffuss BraidHub

kikocis/java-driver public

Merge pull request #775 from datastax/test-updates-for-dse

Updates for testing with DSE Cluster, commit CI config change
Changeset7146e07acfa02cb40558667fa6009dadee038c174fb198de79060e212215256d
AuthorAndrew Tolbert <andrew.tolbert@datastax.com> · 2016-12-15 16:08 -06:00
CommitterGitHub <noreply@github.com> · 2016-12-15 16:08 -06:00
Parentseb74149ffde9, d7b37357011f

Browse the files at this changeset

10 files changed

modified build.yaml +8 −1
@@ -4,7 +4,12 @@
44 schedule: per_commit
55 matrix:
66 exclude:
7- - java: [openjdk6, oraclejdk7]
7+ # Exclude all java 7 builds
8+ - java: oraclejdk7
9+ # Exclude java6 with all versions except latest
10+ - java: openjdk6
11+ cassandra: ['1.2', '2.0', '2.1', '2.2', '3.0']
12+ # Exclude 2.2 and 3.0 always since 3.X provides latest protocol version
813 - cassandra: ['2.2', '3.0']
914 env_vars: |
1015 TEST_GROUP="short"
@@ -39,6 +44,7 @@
3944 cassandra.version=$CCM_CASSANDRA_VERSION
4045 ccm.java.home=$CCM_JAVA_HOME
4146 ccm.path=$CCM_JAVA_HOME/bin
47+ ccm.maxNumberOfNodes=3
4248 failIfNoTests=false
4349 maven.test.failure.ignore=true
4450 maven.javadoc.skip=true
@@ -51,6 +57,7 @@
5157 cassandra.version=$CCM_CASSANDRA_VERSION
5258 ccm.java.home=$CCM_JAVA_HOME
5359 ccm.path=$CCM_JAVA_HOME/bin
60+ ccm.maxNumberOfNodes=3
5461 failIfNoTests=false
5562 maven.test.failure.ignore=true
5663 maven.javadoc.skip=true
modified driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java +101 −19
@@ -34,8 +34,7 @@
3434 import java.util.regex.Matcher;
3535 import java.util.regex.Pattern;
3636
37-import static com.datastax.driver.core.TestUtils.executeNoFail;
38-import static com.datastax.driver.core.TestUtils.findAvailablePort;
37+import static com.datastax.driver.core.TestUtils.*;
3938
4039 public class CCMBridge implements CCMAccess {
4140
@@ -86,11 +85,26 @@
8685 * {@link #getCassandraVersion()}. If C* version cannot be derived, the method makes a 'best guess'.
8786 */
8887 private static final Map<String, String> dseToCassandraVersions = ImmutableMap.<String, String>builder()
89- .put("5.0", "3.0")
88+ .put("5.0.4", "3.0.10")
89+ .put("5.0.3", "3.0.9")
90+ .put("5.0.2", "3.0.8")
91+ .put("5.0.1", "3.0.7")
92+ .put("5.0", "3.0.7")
93+ .put("4.8.11", "2.1.17")
94+ .put("4.8.10", "2.1.15")
95+ .put("4.8.9", "2.1.15")
96+ .put("4.8.8", "2.1.14")
97+ .put("4.8.7", "2.1.14")
98+ .put("4.8.6", "2.1.13")
99+ .put("4.8.5", "2.1.13")
100+ .put("4.8.4", "2.1.12")
90101 .put("4.8.3", "2.1.11")
91102 .put("4.8.2", "2.1.11")
92103 .put("4.8.1", "2.1.11")
93104 .put("4.8", "2.1.9")
105+ .put("4.7.9", "2.1.15")
106+ .put("4.7.8", "2.1.13")
107+ .put("4.7.7", "2.1.12")
94108 .put("4.7.6", "2.1.11")
95109 .put("4.7.5", "2.1.11")
96110 .put("4.7.4", "2.1.11")
@@ -221,7 +235,9 @@
221235
222236 private boolean closed = false;
223237
224- private CCMBridge(String clusterName, boolean isDSE, VersionNumber version, int storagePort, int thriftPort, int binaryPort, String jvmArgs) {
238+ private final int[] nodes;
239+
240+ private CCMBridge(String clusterName, boolean isDSE, VersionNumber version, int storagePort, int thriftPort, int binaryPort, String jvmArgs, int[] nodes) {
225241 this.clusterName = clusterName;
226242 this.version = version;
227243 this.storagePort = storagePort;
@@ -229,6 +245,7 @@
229245 this.binaryPort = binaryPort;
230246 this.isDSE = isDSE;
231247 this.jvmArgs = jvmArgs;
248+ this.nodes = nodes;
232249 this.ccmDir = Files.createTempDir();
233250 }
234251
@@ -379,6 +396,21 @@
379396 logger.debug("Closed: {}", this);
380397 }
381398
399+ /**
400+ * Based on C* version, return the wait arguments.
401+ *
402+ * @return For C* 1.x, --wait-other-notice otherwise --no-wait
403+ */
404+ private String getStartWaitArguments() {
405+ // make a small exception for C* 1.2 as it has a bug where it starts listening on the binary
406+ // interface slightly before it joins the cluster.
407+ if (getCassandraVersion().startsWith("1.")) {
408+ return " --wait-other-notice";
409+ } else {
410+ return " --no-wait";
411+ }
412+ }
413+
382414 @Override
383415 public synchronized void start() {
384416 if (started)
@@ -386,11 +418,23 @@
386418 if (logger.isDebugEnabled())
387419 logger.debug("Starting: {} - free memory: {} MB", this, TestUtils.getFreeMemoryMB());
388420 try {
389- String cmd = CCM_COMMAND + " start --wait-other-notice --wait-for-binary-proto" + jvmArgs;
421+ String cmd = CCM_COMMAND + " start " + jvmArgs + getStartWaitArguments();
390422 if (isWindows() && this.version.compareTo(VersionNumber.parse("2.2.4")) >= 0) {
391423 cmd += " --quiet-windows";
392424 }
393425 execute(cmd);
426+
427+ // Wait for binary interface on each node.
428+ int n = 1;
429+ for (int dc = 1; dc <= nodes.length; dc++) {
430+ int nodesInDc = nodes[dc - 1];
431+ for (int i = 0; i < nodesInDc; i++) {
432+ InetSocketAddress addr = new InetSocketAddress(ipOfNode(n), binaryPort);
433+ logger.debug("Waiting for binary protocol to show up for {}", addr);
434+ TestUtils.waitUntilPortIsUp(addr);
435+ n++;
436+ }
437+ }
394438 } catch (CCMException e) {
395439 logger.error("Could not start " + this, e);
396440 logger.error("CCM output:\n{}", e.getOut());
@@ -448,11 +492,15 @@
448492 public void start(int n) {
449493 logger.debug(String.format("Starting: node %s (%s%s:%s) in %s", n, TestUtils.IP_PREFIX, n, binaryPort, this));
450494 try {
451- String cmd = CCM_COMMAND + " node%d start --wait-other-notice --wait-for-binary-proto" + jvmArgs;
495+ String cmd = CCM_COMMAND + " node%d start " + jvmArgs + getStartWaitArguments();
452496 if (isWindows() && this.version.compareTo(VersionNumber.parse("2.2.4")) >= 0) {
453497 cmd += " --quiet-windows";
454498 }
455499 execute(cmd, n);
500+ // Wait for binary interface
501+ InetSocketAddress addr = new InetSocketAddress(ipOfNode(n), binaryPort);
502+ logger.debug("Waiting for binary protocol to show up for {}", addr);
503+ TestUtils.waitUntilPortIsUp(addr);
456504 } catch (CCMException e) {
457505 logger.error(String.format("Could not start node %s in %s", n, this), e);
458506 logger.error("CCM output:\n{}", e.getOut());
@@ -698,7 +746,7 @@
698746
699747 int[] nodes = {1};
700748 private boolean start = true;
701- private boolean isDSE = isDSE();
749+ private Boolean isDSE = null;
702750 private String version = getCassandraVersion();
703751 private Set<String> createOptions = new LinkedHashSet<String>(getInstallArguments());
704752 private Set<String> jvmArgs = new LinkedHashSet<String>();
@@ -759,11 +807,18 @@
759807 * Sets this cluster to be a DSE cluster (defaults to {@link #isDSE()} if this is never called).
760808 */
761809 public Builder withDSE() {
762- this.createOptions.add("--dse");
763810 this.isDSE = true;
764811 return this;
765812 }
766813
814+ /**
815+ * Sets this cluster to be a non-DSE cluster (defaults to {@link #isDSE()} if this is never called).
816+ */
817+ public Builder withoutDSE() {
818+ this.isDSE = false;
819+ return this;
820+ }
821+
767822 /**
768823 * The Cassandra or DSE version to use (defaults to {@link #getCassandraVersion()} if this is never called).
769824 */
@@ -846,24 +901,38 @@
846901 public CCMBridge build() {
847902 // be careful NOT to alter internal state (hashCode/equals) during build!
848903 String clusterName = TestUtils.generateIdentifier("ccm_");
904+ boolean dse = isDSE == null ? isDSE() : isDSE;
905+
849906 Map<String, Object> cassandraConfiguration = randomizePorts(this.cassandraConfiguration);
850- Map<String, Object> dseConfiguration = randomizePorts(this.dseConfiguration);
851907 VersionNumber version = VersionNumber.parse(this.version);
852908 int storagePort = Integer.parseInt(cassandraConfiguration.get("storage_port").toString());
853909 int thriftPort = Integer.parseInt(cassandraConfiguration.get("rpc_port").toString());
854910 int binaryPort = Integer.parseInt(cassandraConfiguration.get("native_transport_port").toString());
855- final CCMBridge ccm = new CCMBridge(clusterName, isDSE, version, storagePort, thriftPort, binaryPort, joinJvmArgs());
911+ final CCMBridge ccm = new CCMBridge(clusterName, dse, version, storagePort, thriftPort, binaryPort, joinJvmArgs(), nodes);
912+
856913 Runtime.getRuntime().addShutdownHook(new Thread() {
857914 @Override
858915 public void run() {
859916 ccm.close();
860917 }
861918 });
862- ccm.execute(buildCreateCommand(clusterName));
919+ ccm.execute(buildCreateCommand(clusterName, dse));
863920 updateNodeConf(ccm);
864921 ccm.updateConfig(cassandraConfiguration);
865- if (!dseConfiguration.isEmpty())
866- ccm.updateDSEConfig(dseConfiguration);
922+ if (dse) {
923+ Map<String, Object> dseConfiguration = Maps.newLinkedHashMap(this.dseConfiguration);
924+ /* TODO: Use version passed in if present, there is currently a conflation of C* and DSE versions
925+ * when it comes to this that don't want to disturb. No tests are currently using withVersion with
926+ * dse, so its not an issue at the moment. */
927+ if (VersionNumber.parse(CCMBridge.getDSEVersion()).getMajor() >= 5) {
928+ // randomize DSE specific ports if dse present and greater than 5.0
929+ dseConfiguration.put("lease_netty_server_port", RANDOM_PORT);
930+ dseConfiguration.put("internode_messaging_options.port", RANDOM_PORT);
931+ }
932+ dseConfiguration = randomizePorts(dseConfiguration);
933+ if (!dseConfiguration.isEmpty())
934+ ccm.updateDSEConfig(dseConfiguration);
935+ }
867936 for (Map.Entry<Integer, Workload[]> entry : workloads.entrySet()) {
868937 ccm.setWorkload(entry.getKey(), entry.getValue());
869938 }
@@ -895,7 +964,7 @@
895964 return allJvmArgs.toString();
896965 }
897966
898- private String buildCreateCommand(String clusterName) {
967+ private String buildCreateCommand(String clusterName, boolean dse) {
899968 StringBuilder result = new StringBuilder(CCM_COMMAND + " create");
900969 result.append(" ").append(clusterName);
901970 result.append(" -i ").append(TestUtils.IP_PREFIX);
@@ -909,7 +978,20 @@
909978 result.append(node);
910979 }
911980 }
912- result.append(" ").append(Joiner.on(" ").join(randomizePorts(createOptions)));
981+
982+ // If not DSE, remove --dse if in createOptions.
983+ Set<String> lCreateOptions = new LinkedHashSet<String>(createOptions);
984+ if (!dse) {
985+ Iterator<String> it = lCreateOptions.iterator();
986+ while (it.hasNext()) {
987+ String option = it.next();
988+ // remove any version previously set and
989+ // install-dir, which is incompatible
990+ if (option.equals("--dse"))
991+ it.remove();
992+ }
993+ }
994+ result.append(" ").append(Joiner.on(" ").join(randomizePorts(lCreateOptions)));
913995 return result.toString();
914996 }
915997
@@ -1000,14 +1082,14 @@
10001082 if (this == o) return true;
10011083 if (o == null || getClass() != o.getClass()) return false;
10021084 Builder builder = (Builder) o;
1003- if (isDSE != builder.isDSE) return false;
10041085 if (!Arrays.equals(nodes, builder.nodes)) return false;
1086+ if (isDSE != null ? !isDSE.equals(builder.isDSE) : builder.isDSE != null) return false;
1087+ if (!version.equals(builder.version)) return false;
10051088 if (!createOptions.equals(builder.createOptions)) return false;
10061089 if (!jvmArgs.equals(builder.jvmArgs)) return false;
10071090 if (!cassandraConfiguration.equals(builder.cassandraConfiguration)) return false;
10081091 if (!dseConfiguration.equals(builder.dseConfiguration)) return false;
1009- if (!workloads.equals(builder.workloads)) return false;
1010- return version.equals(builder.version);
1092+ return workloads.equals(builder.workloads);
10111093 }
10121094
10131095 @Override
@@ -1015,7 +1097,7 @@
10151097 // do not include cluster name and start, only
10161098 // properties relevant to the settings of the cluster
10171099 int result = Arrays.hashCode(nodes);
1018- result = 31 * result + (isDSE ? 1 : 0);
1100+ result = 31 * result + (isDSE != null ? isDSE.hashCode() : 0);
10191101 result = 31 * result + createOptions.hashCode();
10201102 result = 31 * result + jvmArgs.hashCode();
10211103 result = 31 * result + cassandraConfiguration.hashCode();
modified driver-core/src/test/java/com/datastax/driver/core/CCMTestsSupport.java +10 −4
@@ -271,12 +271,12 @@
271271 }
272272
273273 @SuppressWarnings("SimplifiableIfStatement")
274- private boolean dse() {
274+ private Boolean dse() {
275275 for (CCMConfig ann : annotations) {
276276 if (ann != null && ann.dse().length > 0)
277277 return ann.dse()[0];
278278 }
279- return false;
279+ return null;
280280 }
281281
282282 @SuppressWarnings("SimplifiableIfStatement")
@@ -430,8 +430,14 @@
430430 }
431431 if (version() != null)
432432 ccmBuilder.withVersion(version());
433- if (dse())
434- ccmBuilder.withDSE();
433+ Boolean dse = dse();
434+ if (dse != null) {
435+ if (dse) {
436+ ccmBuilder.withDSE();
437+ } else {
438+ ccmBuilder.withoutDSE();
439+ }
440+ }
435441 if (ssl())
436442 ccmBuilder.withSSL();
437443 if (auth())
modified driver-core/src/test/java/com/datastax/driver/core/HeartbeatTest.java +52 −44
@@ -63,40 +63,44 @@
6363 .setHeartbeatIntervalSeconds(3))
6464 .build());
6565
66- // Don't create any session, only the control connection will be established
67- cluster.init();
68-
69- for (int i = 0; i < 5; i++) {
70- triggerRequestOnControlConnection(cluster);
71- SECONDS.sleep(1);
66+ try {
67+ // Don't create any session, only the control connection will be established
68+ cluster.init();
69+
70+ for (int i = 0; i < 5; i++) {
71+ triggerRequestOnControlConnection(cluster);
72+ SECONDS.sleep(1);
73+ }
74+ assertThat(logs.getNext()).doesNotContain("sending heartbeat");
75+
76+ // Ensure heartbeat is sent after no activity.
77+ SECONDS.sleep(4);
78+ assertThat(logs.getNext())
79+ .contains("sending heartbeat")
80+ .contains("heartbeat query succeeded");
81+
82+ // Ensure heartbeat is sent after continued inactivity.
83+ SECONDS.sleep(4);
84+ assertThat(logs.getNext())
85+ .contains("sending heartbeat")
86+ .contains("heartbeat query succeeded");
87+
88+ // Ensure heartbeat is not sent after activity.
89+ logs.getNext();
90+ for (int i = 0; i < 5; i++) {
91+ triggerRequestOnControlConnection(cluster);
92+ SECONDS.sleep(1);
93+ }
94+ assertThat(logs.getNext()).doesNotContain("sending heartbeat");
95+
96+ // Finally, ensure heartbeat is sent after inactivity.
97+ SECONDS.sleep(4);
98+ assertThat(logs.getNext())
99+ .contains("sending heartbeat")
100+ .contains("heartbeat query succeeded");
101+ } finally {
102+ cluster.close();
72103 }
73- assertThat(logs.getNext()).doesNotContain("sending heartbeat");
74-
75- // Ensure heartbeat is sent after no activity.
76- SECONDS.sleep(4);
77- assertThat(logs.getNext())
78- .contains("sending heartbeat")
79- .contains("heartbeat query succeeded");
80-
81- // Ensure heartbeat is sent after continued inactivity.
82- SECONDS.sleep(4);
83- assertThat(logs.getNext())
84- .contains("sending heartbeat")
85- .contains("heartbeat query succeeded");
86-
87- // Ensure heartbeat is not sent after activity.
88- logs.getNext();
89- for (int i = 0; i < 5; i++) {
90- triggerRequestOnControlConnection(cluster);
91- SECONDS.sleep(1);
92- }
93- assertThat(logs.getNext()).doesNotContain("sending heartbeat");
94-
95- // Finally, ensure heartbeat is sent after inactivity.
96- SECONDS.sleep(4);
97- assertThat(logs.getNext())
98- .contains("sending heartbeat")
99- .contains("heartbeat query succeeded");
100104 }
101105
102106 /**
@@ -119,18 +123,22 @@
119123 .setHeartbeatIntervalSeconds(0))
120124 .build());
121125
122- // Don't create any session, only the control connection will be established
123- cluster.init();
124-
125- for (int i = 0; i < 5; i++) {
126- triggerRequestOnControlConnection(cluster);
127- SECONDS.sleep(1);
126+ try {
127+ // Don't create any session, only the control connection will be established
128+ cluster.init();
129+
130+ for (int i = 0; i < 5; i++) {
131+ triggerRequestOnControlConnection(cluster);
132+ SECONDS.sleep(1);
133+ }
134+ assertThat(logs.get()).doesNotContain("sending heartbeat");
135+
136+ // Sleep for a while and ensure no heartbeat is sent.
137+ SECONDS.sleep(32);
138+ assertThat(logs.get()).doesNotContain("sending heartbeat");
139+ } finally {
140+ cluster.close();
128141 }
129- assertThat(logs.get()).doesNotContain("sending heartbeat");
130-
131- // Sleep for a while and ensure no heartbeat is sent.
132- SECONDS.sleep(32);
133- assertThat(logs.get()).doesNotContain("sending heartbeat");
134142 }
135143
136144 // Simulates activity on the control connection via the internal API
modified driver-core/src/test/java/com/datastax/driver/core/HostMetadataIntegrationTest.java +5 −6
@@ -15,6 +15,7 @@
1515 */
1616 package com.datastax.driver.core;
1717
18+import com.datastax.driver.core.utils.DseVersion;
1819 import org.apache.log4j.Level;
1920 import org.apache.log4j.Logger;
2021 import org.testng.annotations.Test;
@@ -35,24 +36,22 @@
3536 * This test is disabled as running DSE with workloads is intensive and has unreliable results
3637 * when running CCM with multiple workloads.
3738 * <p/>
38- * FIXME: this test is currently disabled because nodes with specific workload
39- * do not seem to come up within the allocated time.
4039 *
4140 * @test_category host:metadata
42- * @jira_ticket JAVA1042
41+ * @jira_ticket JAVA-1042
4342 * @see HostMetadataIntegrationTest#should_parse_dse_workload_and_version_if_available()
4443 */
45- @Test(groups = "long", enabled = false)
44+ @Test(groups = "long")
45+ @DseVersion(major = 5.0)
4646 public void test_mixed_dse_workload() {
4747 CCMBridge.Builder builder = CCMBridge.builder()
4848 .withNodes(3)
4949 .withDSE()
50- .withVersion("4.8.3")
5150 .withWorkload(2, solr)
5251 .withWorkload(3, spark);
5352 CCMAccess ccm = CCMCache.get(builder);
5453
55- VersionNumber version = VersionNumber.parse("4.8.3");
54+ VersionNumber version = VersionNumber.parse(CCMBridge.getDSEVersion());
5655
5756 Cluster cluster = Cluster.builder()
5857 .addContactPoints(ccm.addressOfNode(1).getAddress())
modified driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyBootstrapTest.java +34 −26
@@ -53,12 +53,16 @@
5353 .withLoadBalancingPolicy(policy)
5454 .build());
5555
56- cluster.init();
57-
58- assertThat(policy.history).containsOnly(
59- entry(INIT, TestUtils.findHost(cluster, 1)),
60- entry(INIT, TestUtils.findHost(cluster, 2))
61- );
56+ try {
57+ cluster.init();
58+
59+ assertThat(policy.history).containsOnly(
60+ entry(INIT, TestUtils.findHost(cluster, 1)),
61+ entry(INIT, TestUtils.findHost(cluster, 2))
62+ );
63+ } finally {
64+ cluster.close();
65+ }
6266 }
6367
6468 /**
@@ -95,27 +99,31 @@
9599 .withLoadBalancingPolicy(policy)
96100 .build());
97101
98- cluster.init();
99-
100- if (policy.history.contains(entry(DOWN, TestUtils.findHost(cluster, nodeToStop)))) {
101- // This is the situation we're testing, the control connection tried the stopped node first.
102- assertThat(policy.history).containsExactly(
103- entry(INIT, TestUtils.findHost(cluster, activeNode)),
104- entry(DOWN, TestUtils.findHost(cluster, nodeToStop))
105- );
106- break;
107- } else {
108- assertThat(policy.history).containsOnly(
109- entry(INIT, TestUtils.findHost(cluster, 1)),
110- entry(INIT, TestUtils.findHost(cluster, 2))
111- );
112-
113- logger.info("Could not get first contact point to fail, retrying");
114-
102+ try {
103+ cluster.init();
104+
105+ if (policy.history.contains(entry(DOWN, TestUtils.findHost(cluster, nodeToStop)))) {
106+ // This is the situation we're testing, the control connection tried the stopped node first.
107+ assertThat(policy.history).containsExactly(
108+ entry(INIT, TestUtils.findHost(cluster, activeNode)),
109+ entry(DOWN, TestUtils.findHost(cluster, nodeToStop))
110+ );
111+ break;
112+ } else {
113+ assertThat(policy.history).containsOnly(
114+ entry(INIT, TestUtils.findHost(cluster, 1)),
115+ entry(INIT, TestUtils.findHost(cluster, 2))
116+ );
117+
118+ logger.info("Could not get first contact point to fail, retrying");
119+
120+ cluster.close();
121+
122+ ccm().start(nodeToStop);
123+ ccm().waitForUp(nodeToStop);
124+ }
125+ } finally {
115126 cluster.close();
116-
117- ccm().start(nodeToStop);
118- ccm().waitForUp(nodeToStop);
119127 }
120128 }
121129
modified driver-core/src/test/java/com/datastax/driver/core/ProtocolV1Test.java +1 −1
@@ -25,7 +25,7 @@
2525 /**
2626 * Tests targeting protocol v1 specifically.
2727 */
28-@CCMConfig(version = "1.2.19")
28+@CCMConfig(version = "1.2.19", dse = false)
2929 public class ProtocolV1Test extends CCMTestsSupport {
3030
3131 @Override
modified driver-core/src/test/java/com/datastax/driver/core/RecommissionedNodeTest.java +1 −0
@@ -157,6 +157,7 @@
157157 .withStoragePort(mainCcm.getStoragePort())
158158 .withThriftPort(mainCcm.getThriftPort())
159159 .withBinaryPort(mainCcm.getBinaryPort())
160+ .withoutDSE()
160161 .withVersion("1.2.19");
161162 otherCcm = CCMCache.get(otherCcmBuilder);
162163 otherCcm.waitForUp(1);
modified driver-core/src/test/java/com/datastax/driver/core/TestUtils.java +1 −1
@@ -739,7 +739,7 @@
739739 * @return The desired target protocol version based on the 'cassandra.version' System property.
740740 */
741741 public static ProtocolVersion getDesiredProtocolVersion() {
742- String version = System.getProperty("cassandra.version");
742+ String version = CCMBridge.getCassandraVersion();
743743 String[] versionArray = version.split("\\.|-");
744744 double major = Double.parseDouble(versionArray[0] + "." + versionArray[1]);
745745 if (major < 2.0) {
modified driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java +2 −1
@@ -23,6 +23,8 @@
2323
2424 import static org.assertj.core.api.Assertions.assertThat;
2525
26+@CCMConfig(config = {"batch_size_warn_threshold_in_kb:5"})
27+@CassandraVersion(major = 2.2)
2628 public class WarningsTest extends CCMTestsSupport {
2729
2830 @Override
@@ -30,7 +32,6 @@
3032 execute("CREATE TABLE foo(k int primary key, v text)");
3133 }
3234
33- @CassandraVersion(major = 2.2)
3435 @Test(groups = "short")
3536 public void should_expose_warnings_on_execution_info() {
3637 // the default batch size warn threshold is 5 * 1024 bytes, but after CASSANDRA-10876 there must be