CURATOR-654: Remove watcher after waiting on barrier.#435
Closed
stulscott wants to merge 1 commit intoapache:masterfrom
Closed
CURATOR-654: Remove watcher after waiting on barrier.#435stulscott wants to merge 1 commit intoapache:masterfrom
stulscott wants to merge 1 commit intoapache:masterfrom
Conversation
tisonkun
reviewed
Oct 17, 2022
| * | ||
| * @return true if the barrier is set. | ||
| */ | ||
| public synchronized boolean isSet() throws Exception |
Member
There was a problem hiding this comment.
Annotated with @VisibleForTesting.
tisonkun
reviewed
Oct 17, 2022
Comment on lines
+262
to
+275
| public void testWatchersRemoved() throws Exception | ||
| { | ||
| CuratorFramework client = mock(CuratorFramework.class); | ||
| WatcherRemoveCuratorFramework watcherRemoveClient = mock(WatcherRemoveCuratorFramework.class); | ||
| ExistsBuilder existsBuilder = mock(ExistsBuilder.class); | ||
|
|
||
| when(client.newWatcherRemoveCuratorFramework()).thenReturn(watcherRemoveClient); | ||
| when(watcherRemoveClient.checkExists()).thenReturn(existsBuilder); | ||
| when(existsBuilder.usingWatcher(any(Watcher.class))).thenReturn(existsBuilder); | ||
|
|
||
| final DistributedBarrier barrier = new DistributedBarrier(client, "/barrier"); | ||
| barrier.waitOnBarrier(1, TimeUnit.SECONDS); | ||
| verify(watcherRemoveClient, atLeastOnce()).removeWatchers(); | ||
| } |
Member
There was a problem hiding this comment.
Perhaps add watches and verify the following events triggered:
- DataWatchRemoved
- ChildWatchRemoved
- PersistentWatchRemoved
Member
There was a problem hiding this comment.
I guess it might be particular important to test this as ZooKeeper.removeWatches is cheating since ZOOKEEPER-1910. See also kezhuw/zookeeper-client-rust#2.
Member
There was a problem hiding this comment.
@kezhuw I agree that it can be a bug as I mentioned in https://lists.apache.org/thread/0kcnklcxs0s5656c1sbh3crgdodbb0qg. You can reply on the mailing list and file an issue.
Member
|
Closing as inactive... @kezhuw maybe you're interested in taking over this issue? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.