Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
org.mockito.exceptions.verification.TooLittleActualInvocations: callQueueManager.put(<any>); Wanted 2 times: -> at org.apache.hadoop.ipc.TestIPC.checkBlocking(TestIPC.java:810) But was 1 time: -> at org.apache.hadoop.ipc.Server.queueCall(Server.java:2466) at org.apache.hadoop.ipc.TestIPC.checkBlocking(TestIPC.java:810) at org.apache.hadoop.ipc.TestIPC.testIpcWithReaderQueuing(TestIPC.java:738)
TestIPC.java:810
verify(spy, timeout(100).times(i + 1)).put(Mockito.<Call>anyObject());
The 100ms timeout is too aggressive. If the threads don't start immediately or run more slowly than this main-line code (aka doesn't finish its call in 100ms), the timeout will cause the test to fail. This can be recreated by adding a 150ms timeout to the thread's run method.