You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "tkalkirill (via GitHub)" <gi...@apache.org> on 2023/09/18 14:14:30 UTC

[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #2596: IGNITE-20422 Add events of becoming and ceasing to be a primary replica in the PlacementDriver

tkalkirill commented on code in PR #2596:
URL: https://github.com/apache/ignite-3/pull/2596#discussion_r1328798114


##########
modules/placement-driver/src/test/java/org/apache/ignite/internal/placementdriver/PlacementDriverTest.java:
##########
@@ -356,6 +404,37 @@ private void publishLease(Lease lease) {
                 noop()
         );
 
-        revisionTracker.waitFor(rev + 1).join();
+        long expRev = rev + 1;
+
+        assertThat(revisionTracker.waitFor(expRev), willCompleteSuccessfully());
+
+        return expRev;
+    }
+
+    private CompletableFuture<PrimaryReplicaEventParameters> listenReplicaBecomePrimaryEvent() {
+        var eventParametersFuture = new CompletableFuture<PrimaryReplicaEventParameters>();
+
+        placementDriver.listen(REPLICA_BECOME_PRIMARY, (parameters, exception) -> {
+            eventParametersFuture.complete(parameters);

Review Comment:
   fix it



-- 
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-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org