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 Dec 15, 2017
1 parent b69e533 commit 404a7a8
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -90,13 +90,15 @@ public void testFastLockWithTimeout() throws Throwable {
public void testTryLockWithTimeoutAfterLockWithSmallTimeout() throws Throwable {
assertTrue(await(lock.tryLock()));
CompletableFuture<Boolean> tryLock = lock.tryLock(1, TimeUnit.NANOSECONDS);
TimeUnit.NANOSECONDS.sleep(1);
await(lock.unlock());
assertFalse(await(tryLock));
}

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 Down

0 comments on commit 404a7a8

Please sign in to comment.