Skip to content

Commit

Permalink
GEODE-2916: Fix a flaky timing issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
pivotal-eshu committed May 22, 2017
1 parent ae1c56f commit 8782f0b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
import org.apache.geode.test.junit.categories.DistributedTest;
import org.awaitility.Awaitility;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;

import org.apache.geode.cache.AttributesFactory;
import org.apache.geode.cache.AttributesMutator;
Expand Down Expand Up @@ -222,7 +224,9 @@ public void close() {}
});
}

assertEquals(expected, rgn.getCacheDistributionAdvisor().adviseNetLoad());
Awaitility.await().pollInterval(10, TimeUnit.MILLISECONDS).pollDelay(10, TimeUnit.MILLISECONDS)
.atMost(30, TimeUnit.SECONDS)
.until(() -> assertEquals(expected, rgn.getCacheDistributionAdvisor().adviseNetLoad()));
}

/**
Expand Down

0 comments on commit 8782f0b

Please sign in to comment.