rpuch commented on code in PR #4315:
URL: https://github.com/apache/ignite-3/pull/4315#discussion_r1739634893


##########
modules/system-disaster-recovery/src/integrationTest/java/org/apache/ignite/internal/disaster/system/ItCmgDisasterRecoveryTest.java:
##########
@@ -111,6 +128,11 @@ private CompletableFuture<Void> 
restartOrShutdownFuture(int nodeIndex) {
         return ((IgniteServerImpl) 
cluster.server(nodeIndex)).restartOrShutdownFuture();
     }
 
+    private static ClusterState clusterState(IgniteImpl restartedIgniteImpl1)
+            throws InterruptedException, ExecutionException, TimeoutException {
+        return 
restartedIgniteImpl1.clusterManagementGroupManager().clusterState().get(10, 
SECONDS);

Review Comment:
   What you suggest requires 3 lines:
   ```
   CompletableFuture<T> future = blablaFuture();
   assertThat(future, willCompleteSuccessfully());
   return future.join();
   ```
   But with timed get we only need one line:
   ```
   return blablaFuture().get(...);
   ```
   The matcher-based approach is good when you don't need the result of the 
future, but here produces a code that is too cumbersome.



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

Reply via email to