You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by up...@apache.org on 2018/08/23 23:58:11 UTC
[geode] branch develop updated: GEODE-5617: FIxing a race in
AutoBalancerJUnitTest
This is an automated email from the ASF dual-hosted git repository.
upthewaterspout pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new 9be422c GEODE-5617: FIxing a race in AutoBalancerJUnitTest
9be422c is described below
commit 9be422c93f2dfcaf2ff719b760fe33881d39ba2b
Author: Dan Smith <up...@apache.org>
AuthorDate: Thu Aug 23 13:49:52 2018 -0700
GEODE-5617: FIxing a race in AutoBalancerJUnitTest
This test asserted that execute was invoked exactly twice by a
background timer task. But that task could invoke execute more times
than that if the main test thread is slow.
---
.../java/org/apache/geode/cache/util/AutoBalancerJUnitTest.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/geode-rebalancer/src/test/java/org/apache/geode/cache/util/AutoBalancerJUnitTest.java b/geode-rebalancer/src/test/java/org/apache/geode/cache/util/AutoBalancerJUnitTest.java
index 59e7248..8f164a0 100644
--- a/geode-rebalancer/src/test/java/org/apache/geode/cache/util/AutoBalancerJUnitTest.java
+++ b/geode-rebalancer/src/test/java/org/apache/geode/cache/util/AutoBalancerJUnitTest.java
@@ -541,7 +541,7 @@ public class AutoBalancerJUnitTest {
mockContext.checking(new Expectations() {
{
oneOf(mockAuditor).init(with(any(Properties.class)));
- exactly(2).of(mockAuditor).execute();
+ atLeast(2).of(mockAuditor).execute();
allowing(mockClock).currentTimeMillis();
will(new CustomAction("returnTime") {
@Override
@@ -558,7 +558,7 @@ public class AutoBalancerJUnitTest {
assertEquals(3, latch.getCount());
AutoBalancer autoR = new AutoBalancer(null, mockAuditor, mockClock, null);
autoR.initialize(null, props);
- assertTrue(latch.await(1, TimeUnit.SECONDS));
+ assertTrue(latch.await(1, TimeUnit.MINUTES));
}
@Test
@@ -592,7 +592,7 @@ public class AutoBalancerJUnitTest {
assertEquals(2, latch.getCount());
AutoBalancer autoR = new AutoBalancer(null, mockAuditor, mockClock, null);
autoR.initialize(null, props);
- assertTrue(latch.await(1, TimeUnit.SECONDS));
+ assertTrue(latch.await(1, TimeUnit.MINUTES));
// after destroy no more execute will be called.
autoR.destroy();