pulsar
pulsar copied to clipboard
Flaky-test: org.apache.pulsar.broker.admin.PersistentTopicsTest.setup
Search before reporting
- [x] I searched in the issues and found no similar open issue for this stack trace.
There is an older issue for the same setup method, #16952, but that failure had a different stack trace based on ConcurrentModificationException.
Example failure
https://github.com/apache/pulsar/actions/runs/27806013780/job/82384352336
Exception stacktrace
Gradle suite > Gradle test > org.apache.pulsar.broker.admin.PersistentTopicsTest > setup FAILED
java.lang.AssertionError
at org.mockito.internal.stubbing.InvocationContainerImpl.setMethodForStubbing(InvocationContainerImpl.java:130)
at org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:55)
at org.mockito.internal.handler.NullResultGuardian.handle(NullResultGuardian.java:29)
at org.mockito.internal.handler.InvocationNotifierHandler.handle(InvocationNotifierHandler.java:34)
at org.mockito.internal.creation.bytebuddy.access.MockMethodInterceptor.doIntercept(MockMethodInterceptor.java:84)
at org.mockito.internal.creation.bytebuddy.MockMethodAdvice.handle(MockMethodAdvice.java:143)
at org.apache.pulsar.broker.PulsarService.getPulsarResources(PulsarService.java:313)
at org.apache.pulsar.broker.admin.PersistentTopicsTest.setup(PersistentTopicsTest.java:175)
Gradle suite > Gradle test > org.apache.pulsar.broker.admin.PersistentTopicsTest > cleanup FAILED
org.mockito.exceptions.misusing.UnfinishedStubbingException:
Unfinished stubbing detected here:
-> at org.apache.pulsar.broker.admin.PersistentTopicsTest.setup(PersistentTopicsTest.java:175)
Hints:
1. missing thenReturn()
2. you are trying to stub a final method, which is not supported
3. you are stubbing the behaviour of another mock inside before thenReturn instruction is completed, possibly on another thread
at app//org.apache.pulsar.client.admin.internal.PulsarAdminImpl.close(PulsarAdminImpl.java:448)
at app//org.apache.pulsar.broker.auth.MockedPulsarServiceBaseTest.closeAdmin(MockedPulsarServiceBaseTest.java:323)
at app//org.apache.pulsar.broker.auth.MockedPulsarServiceBaseTest.internalCleanup(MockedPulsarServiceBaseTest.java:296)
at app//org.apache.pulsar.broker.admin.PersistentTopicsTest.cleanup(PersistentTopicsTest.java:191)
Are you willing to submit a PR?
- [x] I am willing to submit a PR!
This might be caused by multi-thread access to create/modify Mockito stubs/mocks. Some previous cases.
A complex example of addressing the problem: https://github.com/apache/pulsar/pull/24165 Simple fix: https://github.com/apache/pulsar/pull/24174
Thanks for the pointer. I'll check this path.