merlimat opened a new pull request #7109: URL: https://github.com/apache/pulsar/pull/7109
### Motivation The `MockZooKeeper#failNow` instructs the `MockZooKeeper` instance to fail the next call to zookeeper. In a multithreaded system with many things accessing zookeeper, using `#failNow` is unreliable, as a background thread could try to access ZK before the call that is actually under tests accesses it. This change tightens the condition on which the failed ZK call can occur, by checking the operation type and path. This resolves a flake that was occurring in `ZooKeeperSessionExpiryRecoveryTest`. ---------------------------------------------------------------- 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