Skip to content

Commit

Permalink
GEODE-5712: Increase Awaitility timeout (apache#2447)
Browse files Browse the repository at this point in the history
* GEODE-5712: increase awaitility timeout

The awaitility timed out after only 1 second, so there was no time to
evaluate the assertion. Awaitility throws a timeout exception once the
duration given in atMost() is reached.

Signed-off-by: Dale Emery<[email protected]>
  • Loading branch information
nonbinaryprogrammer authored Sep 12, 2018
1 parent 4e099fe commit ea5c500
Showing 1 changed file with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ public void before() {
locators.add(clusterStartupRule.startLocatorVM(0));
locators.add(clusterStartupRule.startLocatorVM(1, locators.get(0).getPort()));
locators.add(clusterStartupRule.startLocatorVM(2, locators.get(0).getPort()));


for (MemberVM locator : locators) {
locator.invoke((SerializableRunnableIF) () -> DistributedLockService.create(SERVICE_NAME,
ClusterStartupRule.getCache().getDistributedSystem()));
}
}

@After
Expand All @@ -65,11 +71,6 @@ public void cannotUnlockALockLockedByAnotherVm() {
final AtomicBoolean lock0Status = new AtomicBoolean(false);
final AtomicBoolean lock1Status = new AtomicBoolean(false);

for (MemberVM locator : locators) {
locator.invoke((SerializableRunnableIF) () -> DistributedLockService.create(SERVICE_NAME,
ClusterStartupRule.getCache().getDistributedSystem()));
}

lock0Status.set(locators.get(0)
.invoke(() -> DistributedLockService.getServiceNamed(SERVICE_NAME).lock(lock0, 20, -1)));
lock1Status.set(locators.get(1)
Expand Down Expand Up @@ -109,11 +110,6 @@ public void lockRecoveryAfterGrantorDies() throws Exception {

locators.get(0).invoke(GrantorFailoverDUnitTest::assertIsElderAndGetId);

for (MemberVM locator : locators) {
locator.invoke((SerializableRunnableIF) () -> DistributedLockService.create(SERVICE_NAME,
ClusterStartupRule.getCache().getDistributedSystem()));
}

// Grantor but not the elder
final MemberVM grantorVM = locators.get(1);
final MemberVM survivor1 = locators.get(0);
Expand Down Expand Up @@ -180,7 +176,7 @@ public void lockRecoveryAfterGrantorDies() throws Exception {
private static InternalDistributedMember assertIsElderAndGetId() {
DistributionManager distributionManager =
ClusterStartupRule.getCache().getInternalDistributedSystem().getDistributionManager();
Awaitility.await("Wait to be elder").atMost(1, TimeUnit.SECONDS)
Awaitility.await("Wait to be elder").atMost(2, TimeUnit.MINUTES)
.untilAsserted(() -> assertThat(distributionManager.isElder()).isTrue());
return distributionManager.getElderId();
}
Expand Down

0 comments on commit ea5c500

Please sign in to comment.