Skip to content

Conversation

@annhchen89
Copy link
Contributor

What is the purpose of the change

Fixes an order-dependent (OD) flaky test in Resilience4JPluginTest by preventingnormalTest from being affected by fallback execution triggered inrateLimiterTest.

Resilience4JPluginTest contains three tests:

  • rateLimiterTest (polluter)
  • circuitBreakerTest
  • normalTest (victim)

In rateLimiterTest, the following line executes a real Resilience4J rate-limiter error:

Mono.error(RequestNotPermitted.createRequestNotPermitted(rateLimiter))

This forces the RateLimiterExecutor to execute the Resilience4J rate-limiter error path and fallback logic. So when normalTest runs after it, fallback is executed again, violating verifyComplete() and causing an order-dependent failure.

The Fix

The fix mocks RateLimiterExecutor.run() in normalTest to return Mono.empty(), this prevents execution of the Resilience4J rate-limiter error path and fallback logic, ensuring normalTest completes normally regardless of test execution order.

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant