merlimat opened a new pull request, #25466:
URL: https://github.com/apache/pulsar/pull/25466

   ## Motivation
   
   `MembershipManagerTest.testCheckFailuresSomeFailures` is flaky because 
accumulated Mockito spy invocations from setup and the first `checkFailures` 
call leak into subsequent verification blocks.
   
   ### Stack trace
   ```
   MembershipManagerTest > testCheckFailuresSomeFailures FAILED
       java.lang.AssertionError at MembershipManagerTest.java:240
   ```
   
   ## Modifications
   
   Add `Mockito.clearInvocations(functionRuntimeManager, schedulerManager)` in 
two places:
   1. After setup/`setAssignment` calls and before the first `checkFailures` 
call
   2. Before the second `checkFailures` call
   
   This ensures each `verify(times(...))` assertion only counts invocations 
from its own test section.
   
   ### Documentation
   - [x] `doc-not-required`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to