geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jensde...@apache.org
Subject [geode] branch develop updated: GEODE-5474: Fix test flakiness in DiskRegionAsyncRecoveryJUnitTest an… (#2187)
Date Thu, 26 Jul 2018 02:23:15 GMT
This is an automated email from the ASF dual-hosted git repository.

jensdeppe 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 28facd2  GEODE-5474: Fix test flakiness in DiskRegionAsyncRecoveryJUnitTest an…
(#2187)
28facd2 is described below

commit 28facd2fca75dcc9df78596c558b38b9634ea18a
Author: Jens Deppe <jdeppe@pivotal.io>
AuthorDate: Wed Jul 25 19:23:11 2018 -0700

    GEODE-5474: Fix test flakiness in DiskRegionAsyncRecoveryJUnitTest an… (#2187)
    
    
    - Occasionally these tests will fail if the time between region close and
      re-creation is so short that the PersistenceMemberID is equivalent between
      the old and new values.
---
 .../java/org/apache/geode/internal/cache/DiskOldAPIsJUnitTest.java   | 5 ++++-
 .../geode/internal/cache/DiskRegionAsyncRecoveryJUnitTest.java       | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskOldAPIsJUnitTest.java
b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskOldAPIsJUnitTest.java
index 1f06b14..747b581 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskOldAPIsJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskOldAPIsJUnitTest.java
@@ -26,7 +26,9 @@ import static org.junit.Assert.assertTrue;
 import java.io.File;
 import java.util.Properties;
 import java.util.Set;
+import java.util.concurrent.TimeUnit;
 
+import org.awaitility.Awaitility;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -82,7 +84,7 @@ public class DiskOldAPIsJUnitTest {
     doSyncBitTest(true);
   }
 
-  private void doSyncBitTest(boolean destroyRegion) {
+  private void doSyncBitTest(boolean destroyRegion) throws Exception {
     DiskWriteAttributesFactory dwaf = new DiskWriteAttributesFactory();
     dwaf.setSynchronous(true);
     AttributesFactory af = new AttributesFactory();
@@ -96,6 +98,7 @@ public class DiskOldAPIsJUnitTest {
       r.close();
     }
 
+    Awaitility.await().atLeast(1, TimeUnit.MILLISECONDS).until(() -> true);
     dwaf.setSynchronous(false);
     af.setDiskWriteAttributes(dwaf.create());
     r = cache.createRegion("r", af.create());
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegionAsyncRecoveryJUnitTest.java
b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegionAsyncRecoveryJUnitTest.java
index 41d186c..4df7811 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegionAsyncRecoveryJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegionAsyncRecoveryJUnitTest.java
@@ -27,6 +27,7 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.commons.io.FileUtils;
+import org.awaitility.Awaitility;
 import org.junit.Test;
 
 import org.apache.geode.cache.DataPolicy;
@@ -360,6 +361,8 @@ public class DiskRegionAsyncRecoveryJUnitTest extends DiskRegionTestingBase
{
         recoveryDone.countDown();
       }
     });
+
+    Awaitility.await().atLeast(1, TimeUnit.MILLISECONDS).until(() -> true);
     try {
       region = createRegion();
 


Mime
View raw message