Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.x: CcmBridge version logging; StateListenerTest bugfix #423

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ public class CCMBridge implements CCMAccess {
GLOBAL_DSE_VERSION_NUMBER,
GLOBAL_CASSANDRA_VERSION_NUMBER,
CASSANDRA_INSTALL_ARGS);
} else if (GLOBAL_SCYLLA_VERSION_NUMBER != null) {
GLOBAL_CASSANDRA_VERSION_NUMBER = VersionNumber.parse(inputCassandraVersion);
GLOBAL_DSE_VERSION_NUMBER = null;
logger.info(
"Tests requiring CCM will by default use Scylla version {} and report Cassandra version {} when asked specifically for it (install arguments: {})",
GLOBAL_SCYLLA_VERSION_NUMBER,
GLOBAL_CASSANDRA_VERSION_NUMBER,
CASSANDRA_INSTALL_ARGS);
} else {
GLOBAL_CASSANDRA_VERSION_NUMBER = VersionNumber.parse(inputCassandraVersion);
GLOBAL_DSE_VERSION_NUMBER = null;
Expand Down Expand Up @@ -358,6 +366,10 @@ private static VersionNumber parseScyllaInputVersion(String versionString) {
"Failed to parse scylla.version: " + versionString + ". Trying to get it through CCM.",
e);
parsedScyllaVersionNumber = getScyllaVersionThroughCcm(versionString);
logger.info(
String.format(
"Version string %s corresponds here to version number %s",
versionString, parsedScyllaVersionNumber));
}
return parsedScyllaVersionNumber;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ public void should_receive_events_when_node_states_change() throws InterruptedEx
listener.waitForEvent();

// Different expectation for Scylla versions since 6.0.0 and 2024.2, both included
VersionNumber minOss = VersionNumber.parse("6.0.0");
VersionNumber minEnterprise = VersionNumber.parse("2024.2");
VersionNumber scyllaVer = ccm().getScyllaVersion();
if (scyllaVer != null
&& ((scyllaVer.getMajor() >= 6 && scyllaVer.getMajor() <= 9)
|| (scyllaVer.getMajor() >= 2024 && scyllaVer.getMinor() >= 2))) {
boolean isEnterprise = scyllaVer.getMajor() >= 2017;
if ((isEnterprise && scyllaVer.compareTo(minEnterprise) >= 0)
|| (!isEnterprise && scyllaVer.compareTo(minOss) >= 0)) {
listener.setExpectedEvent(DOWN);
} else {
listener.setExpectedEvent(REMOVE);
Expand Down
Loading