rpuch commented on code in PR #6330:
URL: https://github.com/apache/ignite-3/pull/6330#discussion_r2239864222
##########
modules/low-watermark/src/test/java/org/apache/ignite/internal/lowwatermark/LowWatermarkImplTest.java:
##########
@@ -336,6 +342,36 @@ void
testUpdateAndNotifyNotInvokeFailureManagerWhenGetNodeStoppingException() {
verify(failureManager, never()).process(any());
}
+ @Test
+ void testParallelScheduleUpdates() throws Exception {
+ assertThat(lowWatermarkConfig.updateIntervalMillis().update(300L),
willCompleteSuccessfully());
+
+ assertThat(lowWatermark.startAsync(new ComponentContext()),
willCompleteSuccessfully());
+
+ runRace(
+ () -> lowWatermark.scheduleUpdates(),
+ () -> lowWatermark.scheduleUpdates(),
+ () -> lowWatermark.scheduleUpdates(),
+ () -> lowWatermark.scheduleUpdates()
+ );
+
+ Thread.sleep(1_000);
+
+ verify(lwmChangedListener, atLeast(2)).notify(any());
Review Comment:
But what if this thread gets delayed for some reason for another second?
Will this result in more than 4 invocations?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]