Skip to content

Commit 2777acf

Browse files
authored
3.x: CcmBridge version logging; StateListenerTest bugfix (#423)
* Fix bug in StateListenerTest Recently introduced change has an incorrect version check logic that skips 2025.1.x versions. They won't be skipped anymore. * Adjust cluster version logs in CCMBridge CCMBridge will now report correct Scylla version in use when configured for Scylla, instead of listing the Cassandra version. When using custom cluster version string CCMBridge will output what version number it resolves to.
1 parent c3260c7 commit 2777acf

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

Diff for: driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java

+12
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,14 @@ public class CCMBridge implements CCMAccess {
258258
GLOBAL_DSE_VERSION_NUMBER,
259259
GLOBAL_CASSANDRA_VERSION_NUMBER,
260260
CASSANDRA_INSTALL_ARGS);
261+
} else if (GLOBAL_SCYLLA_VERSION_NUMBER != null) {
262+
GLOBAL_CASSANDRA_VERSION_NUMBER = VersionNumber.parse(inputCassandraVersion);
263+
GLOBAL_DSE_VERSION_NUMBER = null;
264+
logger.info(
265+
"Tests requiring CCM will by default use Scylla version {} and report Cassandra version {} when asked specifically for it (install arguments: {})",
266+
GLOBAL_SCYLLA_VERSION_NUMBER,
267+
GLOBAL_CASSANDRA_VERSION_NUMBER,
268+
CASSANDRA_INSTALL_ARGS);
261269
} else {
262270
GLOBAL_CASSANDRA_VERSION_NUMBER = VersionNumber.parse(inputCassandraVersion);
263271
GLOBAL_DSE_VERSION_NUMBER = null;
@@ -358,6 +366,10 @@ private static VersionNumber parseScyllaInputVersion(String versionString) {
358366
"Failed to parse scylla.version: " + versionString + ". Trying to get it through CCM.",
359367
e);
360368
parsedScyllaVersionNumber = getScyllaVersionThroughCcm(versionString);
369+
logger.info(
370+
String.format(
371+
"Version string %s corresponds here to version number %s",
372+
versionString, parsedScyllaVersionNumber));
361373
}
362374
return parsedScyllaVersionNumber;
363375
}

Diff for: driver-core/src/test/java/com/datastax/driver/core/StateListenerTest.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ public void should_receive_events_when_node_states_change() throws InterruptedEx
5353
listener.waitForEvent();
5454

5555
// Different expectation for Scylla versions since 6.0.0 and 2024.2, both included
56+
VersionNumber minOss = VersionNumber.parse("6.0.0");
57+
VersionNumber minEnterprise = VersionNumber.parse("2024.2");
5658
VersionNumber scyllaVer = ccm().getScyllaVersion();
57-
if (scyllaVer != null
58-
&& ((scyllaVer.getMajor() >= 6 && scyllaVer.getMajor() <= 9)
59-
|| (scyllaVer.getMajor() >= 2024 && scyllaVer.getMinor() >= 2))) {
59+
boolean isEnterprise = scyllaVer.getMajor() >= 2017;
60+
if ((isEnterprise && scyllaVer.compareTo(minEnterprise) >= 0)
61+
|| (!isEnterprise && scyllaVer.compareTo(minOss) >= 0)) {
6062
listener.setExpectedEvent(DOWN);
6163
} else {
6264
listener.setExpectedEvent(REMOVE);

0 commit comments

Comments
 (0)