Ivan Zlenko created IGNITE-28355:
------------------------------------

             Summary: ItNodeTest.testNewPeersConfigurationAppliedListener is 
potentially flaky due to race between async listener callback and verify
                 Key: IGNITE-28355
                 URL: https://issues.apache.org/jira/browse/IGNITE-28355
             Project: Ignite
          Issue Type: Improvement
          Components: raft ai3
            Reporter: Ivan Zlenko
            Assignee: Ivan Zlenko


The test calls changePeersAndLearnersAsync in a loop, each iteration changing 
the RAFT group to a single new peer + learner. After each change, it waits for 
the new leader to appear via waitForCondition, then immediately verifies that 
onNewPeersConfigurationApplied was called on the mock listener.
                                                                                
                                                                                
                                                                 
The problem is that onNewPeersConfigurationApplied is scheduled asynchronously 
on the old leader's common executor, while the test's waitForCondition only 
checks that the new leader has been elected. The new leader election can 
complete before the old leader's executor processes the listener callback, 
causing verify(times(1)) to fail.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to