ibessonov commented on code in PR #2319:
URL: https://github.com/apache/ignite-3/pull/2319#discussion_r1265024255


##########
modules/core/src/test/java/org/apache/ignite/internal/causality/IncrementalVersionedValueTest.java:
##########
@@ -341,6 +344,51 @@ void testCompleteMultipleFutures() {
         assertThat(future3, willBe(2));
     }
 
+    /**
+     * Tests that {@link 
IncrementalVersionedValue#dependingOn(IncrementalVersionedValue)} provides 
causality between 2 different values.
+     */
+    @RepeatedTest(100)
+    public void testDependingOn() {
+        var vv0 = new IncrementalVersionedValue<>(register, () -> 1);
+
+        var vv1 = new IncrementalVersionedValue<>(dependingOn(vv0), () -> 1);
+
+        int token = 1;
+
+        vv0.update(token, (i, e) -> completedFuture(i + 1));
+
+        vv1.update(token, (i, e) -> completedFuture(i + 1));
+
+        register.moveRevision(token);
+
+        // Will always complete in time.
+        vv1.get(token).join();
+
+        assertTrue(vv0.get(token).isDone());
+    }
+
+    /**
+     * Tests that {@link IncrementalVersionedValue#update(long, BiFunction)} 
closure is called immediately when underlying value is
+     * accessible, i.e. when there were no other updates.
+     */
+    @Test
+    public void testImmediateUpdate() {

Review Comment:
   Done



-- 
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]

Reply via email to