}
@Test(timeout = 60000)
public void testUnlock_whenPendingLockOfOtherThread() throws InterruptedException {
HazelcastInstance instance = createHazelcastInstance();
final ILock lock = instance.getLock(randomString());
lock.lock();
final CountDownLatch latch = new CountDownLatch(1);
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
lock.lock();
latch.countDown();
}
});
thread.start();
lock.unlock();
latch.await();
assertTrue(lock.isLocked());
assertFalse(lock.isLockedByCurrentThread());
}