HDFS-12675. Ozone: TestLeaseManager#testLeaseCallbackWithMultipleLeases fails. Contributed by Yiqun Lin.
This commit is contained in:
parent
0f0417a12c
commit
cc86719451
|
@ -138,7 +138,7 @@ public class TestLeaseManager {
|
||||||
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 class TestLeaseManager {
|
||||||
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 class TestLeaseManager {
|
||||||
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 class TestLeaseManager {
|
||||||
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) {
|
||||||
|
|
Loading…
Reference in New Issue