This is an automated email from the ASF dual-hosted git repository.
sai_boorlagadda 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 d185c4a GEODE-5212: fix timing issues in BeforeCompletionTest (#2565)
d185c4a is described below
commit d185c4a44ce462c63c671542237bcd9cebcdee8c
Author: Sai Boorlagadda <[email protected]>
AuthorDate: Fri Oct 5 07:59:48 2018 -0700
GEODE-5212: fix timing issues in BeforeCompletionTest (#2565)
Signed-off-by: Kirk Lund <[email protected]>
---
.../apache/geode/internal/cache/BeforeCompletionTest.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git
a/geode-core/src/test/java/org/apache/geode/internal/cache/BeforeCompletionTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/BeforeCompletionTest.java
index cbd5a18..51b790e 100644
---
a/geode-core/src/test/java/org/apache/geode/internal/cache/BeforeCompletionTest.java
+++
b/geode-core/src/test/java/org/apache/geode/internal/cache/BeforeCompletionTest.java
@@ -16,9 +16,9 @@ package org.apache.geode.internal.cache;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.concurrent.TimeUnit;
@@ -81,7 +81,7 @@ public class BeforeCompletionTest {
public void doOpCallsDoBeforeCompletion() {
beforeCompletion.doOp(txState);
- verify(txState, times(1)).doBeforeCompletion();
+ verify(txState).doBeforeCompletion();
}
@Test
@@ -106,17 +106,17 @@ public class BeforeCompletionTest {
}
@Test
- public void executeWaitsUntilDoOpFinish() throws Exception {
+ public void executeWaitsUntilDoOpFinish() {
Thread thread = new Thread(() ->
beforeCompletion.execute(cancelCriterion));
thread.start();
// give the thread a chance to get past the "finished" check by waiting
until
// checkCancelInProgress is called
- Awaitility.await().atMost(60, TimeUnit.SECONDS)
- .untilAsserted(() -> verify(cancelCriterion,
times(1)).checkCancelInProgress(null));
+ Awaitility.await().atMost(5, TimeUnit.MINUTES)
+ .untilAsserted(() -> verify(cancelCriterion,
atLeastOnce()).checkCancelInProgress(null));
beforeCompletion.doOp(txState);
- Awaitility.await().atMost(60, TimeUnit.SECONDS).until(() ->
!(thread.isAlive()));
+ Awaitility.await().atMost(5, TimeUnit.MINUTES).until(() ->
!(thread.isAlive()));
}
}