HDFS-12675. Ozone: TestLeaseManager#testLeaseCallbackWithMultipleLeases fails. Contributed by Yiqun Lin.

This commit is contained in:
Nanda kumar 2017-10-20 00:39:44 +05:30 committed by Owen O'Malley
parent 0f0417a12c
commit cc86719451

View File

@ -138,7 +138,7 @@ public void testLeaseNotFound() throws LeaseException, InterruptedException {
Lease<DummyResource> leaseThree = manager.acquire(resourceThree); Lease<DummyResource> leaseThree = manager.acquire(resourceThree);
Assert.assertEquals(leaseThree, manager.get(resourceThree)); Assert.assertEquals(leaseThree, manager.get(resourceThree));
Assert.assertFalse(leaseThree.hasExpired()); Assert.assertFalse(leaseThree.hasExpired());
long sleepTime = leaseThree.getRemainingTime() + 5; long sleepTime = leaseThree.getRemainingTime() + 1000;
try { try {
Thread.sleep(sleepTime); Thread.sleep(sleepTime);
} catch (InterruptedException ex) { } catch (InterruptedException ex) {
@ -189,7 +189,7 @@ public void testLeaseCallback() throws LeaseException, InterruptedException {
return null; return null;
}); });
// wait for lease to expire // wait for lease to expire
long sleepTime = leaseOne.getRemainingTime() + 5; long sleepTime = leaseOne.getRemainingTime() + 1000;
try { try {
Thread.sleep(sleepTime); Thread.sleep(sleepTime);
} catch (InterruptedException ex) { } catch (InterruptedException ex) {
@ -278,7 +278,7 @@ public void testLeaseCallbackWithMultipleLeases()
manager.release(resourceThree); manager.release(resourceThree);
// wait for other leases to expire // wait for other leases to expire
long sleepTime = leaseFive.getRemainingTime() + 10; long sleepTime = leaseFive.getRemainingTime() + 1000;
try { try {
Thread.sleep(sleepTime); Thread.sleep(sleepTime);
@ -332,7 +332,7 @@ public void testReuseTimedOutLease()
Assert.assertFalse(leaseOne.hasExpired()); Assert.assertFalse(leaseOne.hasExpired());
// wait for lease to expire // wait for lease to expire
long sleepTime = leaseOne.getRemainingTime() + 5; long sleepTime = leaseOne.getRemainingTime() + 1000;
try { try {
Thread.sleep(sleepTime); Thread.sleep(sleepTime);
} catch (InterruptedException ex) { } catch (InterruptedException ex) {