rpuch commented on code in PR #6199: URL: https://github.com/apache/ignite-3/pull/6199#discussion_r2191766953
########## modules/metastorage/src/test/java/org/apache/ignite/internal/metastorage/server/WatchProcessorTest.java: ########## @@ -288,6 +289,48 @@ void nodeStoppingExceptionDoesNotTriggerFailureManager() { verify(failureManager, never()).process(any()); } + @Test + void eventNotificationUpdatesMetastoreSafeTimeAfterNotifyingWatchListeners() { + CompletableFuture<Void> listenerFuture = new CompletableFuture<>(); + WatchListener listener = mock(WatchListener.class); + when(listener.onUpdate(any())).thenReturn(listenerFuture); + + watchProcessor.addWatch(new Watch(0, listener, key -> Arrays.equals(key, "foo".getBytes(UTF_8)))); + + var entry1 = new EntryImpl("foo".getBytes(UTF_8), null, 1, TIMESTAMP); + HybridTimestamp ts = new HybridTimestamp(1, 2); + + watchProcessor.notifyWatches(1, List.of(entry1), ts); + + verify(watchEventHandlingCallback, timeout(100).times(0)).onSafeTimeAdvanced(any()); Review Comment: In this case, this can't lead to flakiness as this line makes sure that the callback is NOT called in 100ms. Even if there is a pause and we don't see the callback having been called due to the pause (while it WAS actually called), this will not fail the test. But this line is still useful as in most cases it will demonstrate that the call was not made at all -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org