Skip to content

[fix][test] Fix flaky MembershipManagerTest.testCheckFailuresSomeFailures#25466

Open
merlimat wants to merge 1 commit intoapache:masterfrom
merlimat:fix/flaky-MembershipManagerTest
Open

[fix][test] Fix flaky MembershipManagerTest.testCheckFailuresSomeFailures#25466
merlimat wants to merge 1 commit intoapache:masterfrom
merlimat:fix/flaky-MembershipManagerTest

Conversation

@merlimat
Copy link
Copy Markdown
Contributor

@merlimat merlimat commented Apr 3, 2026

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

  • doc-not-needed

…ures

Add clearInvocations on Mockito spies between setup and first
checkFailures call, and between the two checkFailures calls, to
prevent accumulated invocations from interfering with times()
assertions.
@github-actions github-actions bot added doc-label-missing doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Apr 3, 2026
@apache apache deleted a comment from github-actions bot Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/test doc-not-needed Your PR changes do not impact docs ready-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant