Skip to content

Commit

Permalink
ISPN-8615 Test fix small timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
karesti committed Jan 11, 2018
1 parent b69e533 commit a8541d2
Showing 1 changed file with 2 additions and 8 deletions.
Expand Up @@ -89,14 +89,13 @@ public void testFastLockWithTimeout() throws Throwable {

public void testTryLockWithTimeoutAfterLockWithSmallTimeout() throws Throwable {
assertTrue(await(lock.tryLock()));
CompletableFuture<Boolean> tryLock = lock.tryLock(1, TimeUnit.NANOSECONDS);
await(lock.unlock());
assertFalse(await(tryLock));
assertFalse(await(lock.tryLock(1, TimeUnit.NANOSECONDS)));
}

public void testTryLockWithTimeoutAfterLockWithBigTimeout() throws Throwable {
assertTrue(await(lock.tryLock()));
CompletableFuture<Boolean> tryLock = lock.tryLock(1, TimeUnit.SECONDS);
TimeUnit.MILLISECONDS.sleep(100);
await(lock.unlock());
assertTrue(await(tryLock));
}
Expand All @@ -121,7 +120,6 @@ public void testLockAfterLockRemove() throws Throwable {
await(call
.exceptionally(e -> {
assertException(ClusteredLockException.class, e);
//assertEquals(Log.LOCK_DELETE_MSG, e.getMessage());
return null;
}));
assertTrue(call.isCompletedExceptionally());
Expand All @@ -134,7 +132,6 @@ public void testTryLockAfterLockRemove() throws Throwable {
await(call
.exceptionally(e -> {
assertException(ClusteredLockException.class, e);
//assertEquals(Log.LOCK_DELETE_MSG, e.getMessage());
return null;
}));
assertTrue(call.isCompletedExceptionally());
Expand All @@ -147,7 +144,6 @@ public void testTryLockWithTimeoutAfterLockRemove() throws Throwable {
await(call
.exceptionally(e -> {
assertException(ClusteredLockException.class, e);
//assertEquals(Log.LOCK_DELETE_MSG, e.getMessage());
return null;
}));
assertTrue(call.isCompletedExceptionally());
Expand All @@ -160,7 +156,6 @@ public void testIsLockedAfterLockRemove() throws Throwable {
await(call
.exceptionally(e -> {
assertException(ClusteredLockException.class, e);
//assertEquals(Log.LOCK_DELETE_MSG, e.getMessage());
return null;
}));
assertTrue(call.isCompletedExceptionally());
Expand All @@ -173,7 +168,6 @@ public void testIsLockedByMeAfterLockRemove() throws Throwable {
await(call
.exceptionally(e -> {
assertException(ClusteredLockException.class, e);
//assertEquals(Log.LOCK_DELETE_MSG, e.getMessage());
return null;
}));
assertTrue(call.isCompletedExceptionally());
Expand Down

0 comments on commit a8541d2

Please sign in to comment.