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 d4cb048
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit d4cb048

Please sign in to comment.