Abhishek Pal created RATIS-2442:
-----------------------------------
Summary: Fix flakiness for testChangeListenerToFollower
Key: RATIS-2442
URL: https://issues.apache.org/jira/browse/RATIS-2442
Project: Ratis
Issue Type: Improvement
Components: test
Reporter: Abhishek Pal
Assignee: Abhishek Pal
Sometimes 'testChangeListenerToFollower' checks for the listener role too early.
*setConfiguration()* returns once the reconfiguration is committed, but the
listener node flips to follower later when the config entry is applied.
The example scenario is as follows:
- client gets *setConfiguration()* success
- leader’s conf already shows no listeners
- the old listener may still be counted as a listener for a moment
- *cluster.getListeners()* can still return *1* due to this
The fix is to wait for the new configuration to settle before asserting on
cluster.getListeners().
We can follow the other reconfiguration tests and use
*RaftServerTestUtil.waitAndCheckNewConf()* to wait.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)