Skip to content

Commit

Permalink
Adjust StateListenerTest
Browse files Browse the repository at this point in the history
In newer Scylla versions ccm node decomission first causes DOWN event
to be sent and then REMOVE. This change adjusts the expected event so that
the test passes.
  • Loading branch information
Bouncheck committed Jan 20, 2025
1 parent db99210 commit 105ac0f
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ public void should_receive_events_when_node_states_change() throws InterruptedEx
ccm().start(1);
listener.waitForEvent();

listener.setExpectedEvent(REMOVE);
// Different expectation for Scylla versions since 6.0.0 and 2024.2, both included
VersionNumber scyllaVer = ccm().getScyllaVersion();
if (scyllaVer != null
&& ((scyllaVer.getMajor() >= 6 && scyllaVer.getMajor() <= 9)
|| (scyllaVer.getMajor() >= 2024 && scyllaVer.getMinor() >= 2))) {
listener.setExpectedEvent(DOWN);
} else {
listener.setExpectedEvent(REMOVE);
}
ccm().decommission(2);
listener.waitForEvent();
}
Expand Down Expand Up @@ -91,7 +99,7 @@ private void reportActualEvent(Event event) {
event);
return;
}
logger.debug("Got event {}", event);
logger.info("Got event {}", event);
actualEvent = event;
latch.countDown();
}
Expand Down

0 comments on commit 105ac0f

Please sign in to comment.