vldpyatkov commented on code in PR #1871:
URL: https://github.com/apache/ignite-3/pull/1871#discussion_r1156916152
##########
modules/placement-driver/src/integrationTest/java/org/apache/ignite/internal/placementdriver/PlacementDriverManagerTest.java:
##########
@@ -288,11 +355,72 @@ public void testLeaseholderUpdate() throws Exception {
Lease lease = ByteUtils.fromBytes(fut.join().value());
- return lease.getLeaseExpirationTime().compareTo(clock.now()) > 0;
+ return lease.getExpirationTime().compareTo(clock.now()) > 0;
}, 10_000));
}
+ @Test
+ public void testLeaseAccepted() throws Exception {
+ TablePartitionId grpPart0 = createTableAssignment();
+
+ checkLeaseCreated(grpPart0);
+
+ checkAccepted(grpPart0);
+ }
+
+ @Test
+ public void testLeaseForceAccepted() throws Exception {
+ leaseGrantHandler = (req, sender) ->
+ PLACEMENT_DRIVER_MESSAGES_FACTORY
+ .leaseGrantedMessageResponse()
+ .accepted(req.force())
+ .build();
+
+ TablePartitionId grpPart0 = createTableAssignment();
+
+ checkLeaseCreated(grpPart0);
+
+ checkAccepted(grpPart0);
+ }
+
+ @Test
+ public void testExceptionOnAcceptance() throws Exception {
+ CountDownLatch latch = new CountDownLatch(1);
+
+ leaseGrantHandler = (req, sender) -> {
+ latch.countDown();
+
+ throw new RuntimeException("test");
Review Comment:
The test shows that our logic is persistent against any exception.
--
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]