vldpyatkov commented on code in PR #1871:
URL: https://github.com/apache/ignite-3/pull/1871#discussion_r1156933782


##########
modules/placement-driver/src/integrationTest/java/org/apache/ignite/internal/placementdriver/PlacementDriverManagerTest.java:
##########
@@ -321,6 +449,45 @@ private void checkLeaseCreated(TablePartitionId grpPartId) 
throws InterruptedExc
         }, 10_000));
     }
 
+    /**
+     * Checks that the lease for the group is accepted.
+     *
+     * @param grpPartId Replication group id.
+     * @throws InterruptedException If the waiting is interrupted.
+     */
+    private void checkAccepted(TablePartitionId grpPartId) throws 
InterruptedException {
+        assertTrue(waitForCondition(() -> {
+            var leaseFut = 
metaStorageManager.get(fromString(PLACEMENTDRIVER_PREFIX + grpPartId));
+
+            var leaseEntry = leaseFut.join();
+
+            if (leaseEntry != null && !leaseEntry.empty()) {
+                Lease lease = ByteUtils.fromBytes(leaseEntry.value());
+
+                return lease.isAccepted();
+            }
+
+            return false;
+        }, 10_000));

Review Comment:
   We don't deserialize the object in `checkLeaseCreated` method. But if you 
insist, I will rewrite `checkLeaseCreated` and that through the one method 
(`readLease`)



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