Skip to content

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

Merged
nodece merged 1 commit intoapache:masterfrom
merlimat:fix/flaky-MembershipManagerTest
Apr 7, 2026
Merged

[fix][test] Fix flaky MembershipManagerTest.testCheckFailuresSomeFailures#25466
nodece merged 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
@nodece nodece merged commit 3bbe99c into apache:master Apr 7, 2026
45 of 47 checks passed
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.

2 participants