We then try to run the assertion here but the blacklist is already empty, so we fail
The relevant change is this PR is only to set the hosts to be returned by cassandra.getCurrentServerListFromConfig to match what we're actually using in the tests, so it doesn't get reset by the background task.
nit: when(config.autoRefreshNodes()).thenReturn(false); was not necessarily needed, since it was already returning false. But adding it for clarity, since when investigating the behaviour wasn't obvious to me: despite the default value for such config being True, if you don't provide the return for a mocked a boolean method, it will return false.
After this PR:
==COMMIT_MSG==
CassandraClientPoolTest resilientToRollingRestarts() method shouldn't be flaky anymore.
==COMMIT_MSG==
General
Before this PR:
This test was previously flaky (example), failing to assert that the node we forced the failure on was present on the blacklist.
There were a few problems that caused the test to behave in such way:
CASS_SERVER_1
added to the blacklist, but haven't yet checked the assertionThe relevant change is this PR is only to set the hosts to be returned by
cassandra.getCurrentServerListFromConfig
to match what we're actually using in the tests, so it doesn't get reset by the background task.nit:
when(config.autoRefreshNodes()).thenReturn(false);
was not necessarily needed, since it was already returningfalse
. But adding it for clarity, since when investigating the behaviour wasn't obvious to me: despite the default value for such config being True, if you don't provide the return for a mocked a boolean method, it will returnfalse
.After this PR:
==COMMIT_MSG== CassandraClientPoolTest resilientToRollingRestarts() method shouldn't be flaky anymore. ==COMMIT_MSG==