*/
public void testConcurrentRemoteLock() throws Exception
{
TesteeSet<NonGloballyExclusiveClusterLockSupport> testeeSet = getTesteeSet(node1, 1, 3);
NonGloballyExclusiveClusterLockSupport testee = testeeSet.impl;
LocalLockHandler handler = testee.getLocalHandler();
final RpcTarget target = testeeSet.target;
ClusterNode caller1 = testee.getCurrentView().get(0);
assertFalse(node1.equals(caller1));
ClusterNode caller2 = testee.getCurrentView().get(2);
assertFalse(node1.equals(caller2));
resetToStrict(handler);
makeThreadSafe(handler, true);
// When caller 1 invokes, block before giving response
CountDownLatch answerStartLatch = new CountDownLatch(1);
CountDownLatch answerDoneLatch = new CountDownLatch(1);
BlockingAnswer<Boolean> caller1Answer = new BlockingAnswer<Boolean>(Boolean.TRUE, answerStartLatch, null, answerDoneLatch);
BlockingAnswer<Boolean> caller2Answer = new BlockingAnswer<Boolean>(new TimeoutException(caller1), answerDoneLatch, 0, null, null);
handler.lockFromCluster("test", caller1, 1000);
expectLastCall().andAnswer(caller1Answer);
handler.lockFromCluster("test", caller2, 1000);
// There is a race where t1 may have already marked the lock as LOCKED in
// which case t2 will not call handler.lockFromCluster("test", caller2, 1000);
// See FIXME in method javadoc. So, we use times(0, 1) to specify no