RongtongJin opened a new issue, #10413:
URL: https://github.com/apache/rocketmq/issues/10413

   ### Before Creating the Bug Report\n\n- [x] I have confirmed this is a bug 
in tests/CI.\n\n### Runtime platform environment\n\nGitHub Actions Ubuntu JDK 8 
Maven CI.\n\n### RocketMQ version\n\nDevelop branch / 5.5.0-SNAPSHOT test 
suite.\n\n### JDK Version\n\nJDK 8 in CI.\n\n### Describe the Bug\n\nThe Maven 
CI can fail in client tests with Mockito UnfinishedStubbing while running 
DefaultLitePullConsumerTest.testSubscribe_BroadcastPollMessageSuccess. The 
failure points to initDefaultLitePullConsumer while setting up spy-based 
stubs.\n\nFailure 
excerpt:\n\n```\nDefaultLitePullConsumerTest.testSubscribe_BroadcastPollMessageSuccess:236->createBroadcastLitePullConsumer:873->initDefaultLitePullConsumer:749
 UnfinishedStubbing\n```\n\nThe test stubs methods through the MQClientInstance 
spy and also calls the spy while preparing stubbing return values, which can 
leave Mockito in an unfinished stubbing state.\n\n### Steps to Reproduce\n\nRun 
the Maven client test suite in CI.\n\n### What Did
  You Expect to See?\n\nDefaultLitePullConsumerTest should not fail during 
Mockito stubbing setup.\n\n### What Did You See Instead?\n\nThe test 
intermittently fails with Mockito UnfinishedStubbing before assertions 
run.\n\n### Additional Context\n\nThe fix is to stub the injected 
MQClientAPIImpl mock directly and avoid invoking the MQClientInstance spy while 
preparing doReturn/when stubs.


-- 
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