guozhangwang commented on PR #13319:
URL: https://github.com/apache/kafka/pull/13319#issuecomment-1450512377

   Honestly I do not quite understanding how mockito is messing here.. take 
`shouldPauseActiveTaskAndTransitToUpdateStandby` for example, after task1 
(named topologyA) and task2 (named topologyB) are updating, then there's the 
line `when(topologyMetadata.isPaused("A")).thenReturn(true);`. In succeeding 
cases, task1 is indeed paused, and everything works just fine; however in those 
flaky failing cases, task2 is paused instead, indicating 
`topologyMetadata.isPaused("B")` returns true but 
`topologyMetadata.isPaused("A")` returns false... I honestly have no idea why 
that could happen, but after changing that to 
`when(topologyMetadata.isPaused(task1.id().topologyName())).thenReturn(false).thenReturn(true);`
 (i.e. let it to return false on the first call when adding task, and then 
return true on the second call to pause) I did not see that test failing any 
more. I checked mockito's docs but still do not see how `when` could mess up on 
the return values, so I kinda fixed it but do not know 
 exactly why I fixed it..


-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to