hachikuji edited a comment on pull request #10006:
URL: https://github.com/apache/kafka/pull/10006#issuecomment-770119487


   @abbccdda See for example this trace, which is often found in an unrelated 
test case (https://github.com/apache/kafka/runs/1794689847):
   ```
   org.mockito.exceptions.misusing.UnfinishedStubbingException: 
   Unfinished stubbing detected here:
   -> at 
org.apache.kafka.clients.consumer.internals.FetcherTest.testEarlierOffsetResetArrivesLate(FetcherTest.java:1761)
   
   E.g. thenReturn() may be missing.
   Examples of correct stubbing:
       when(mock.isOk()).thenReturn(true);
       when(mock.isOk()).thenThrow(exception);
       doThrow(exception).when(mock).someVoidMethod();
   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
   ```
   I could not come up with an explanation for this, nor could I reproduce it. 
What I suspect is that mockito is not really safe for multi-threaded access as 
the test case assumes. After looking at the test case, it seemed better to just 
rewrite it since we do not need multiple threads.
   


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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to