Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MockZooKeeper#failNow is unreliable #7109

Merged
merged 2 commits into from
Jun 1, 2020
Merged

Conversation

merlimat
Copy link
Contributor

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.

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 occuring in ZooKeeperSessionExpiryRecoveryTest.
@merlimat merlimat added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages area/test type/flaky-tests labels May 30, 2020
@merlimat merlimat added this to the 2.6.0 milestone May 30, 2020
@merlimat merlimat merged commit 7314ac2 into apache:master Jun 1, 2020
@merlimat merlimat deleted the pr-b0d905205f branch June 1, 2020 16:19
Huanli-Meng pushed a commit to Huanli-Meng/pulsar that referenced this pull request Jun 12, 2020
* MockZooKeeper#failNow is unreliable

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 occuring in ZooKeeperSessionExpiryRecoveryTest.

* Fixed import missing after merge

Co-authored-by: Ivan Kelly <ikelly@splunk.com>
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
* MockZooKeeper#failNow is unreliable

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 occuring in ZooKeeperSessionExpiryRecoveryTest.

* Fixed import missing after merge

Co-authored-by: Ivan Kelly <ikelly@splunk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages type/flaky-tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants