You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by es...@apache.org on 2018/08/03 21:15:07 UTC

[geode] branch develop updated: GEODE-5524: Fix a race by waiting on correct condition. (#2258)

This is an automated email from the ASF dual-hosted git repository.

eshu11 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 f355664  GEODE-5524: Fix a race by waiting on correct condition. (#2258)
f355664 is described below

commit f35566475894a83390a2d8eb6dc17bca0b9afc2c
Author: pivotal-eshu <es...@pivotal.io>
AuthorDate: Fri Aug 3 14:15:01 2018 -0700

    GEODE-5524: Fix a race by waiting on correct condition. (#2258)
---
 ...rTransactionFailoverWithMixedVersionServersDistributedTest.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionFailoverWithMixedVersionServersDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionFailoverWithMixedVersionServersDistributedTest.java
index 6a96176..b815950 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionFailoverWithMixedVersionServersDistributedTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionFailoverWithMixedVersionServersDistributedTest.java
@@ -115,6 +115,7 @@ public class ClientServerTransactionFailoverWithMixedVersionServersDistributedTe
     setupPartiallyRolledVersion();
 
     server1.invoke(() -> createServerRegion(1, false));
+    server1.invoke(() -> cacheRule.getCache().getRegion(regionName).put(1, "originalValue"));
     server2.invoke(() -> createServerRegion(1, true));
     server3.invoke(() -> createServerRegion(1, true));
     server4.invoke(() -> createServerRegion(1, true));
@@ -126,6 +127,8 @@ public class ClientServerTransactionFailoverWithMixedVersionServersDistributedTe
     int numOfOperations = 12;
     client.invokeAsync(() -> doTransactions(numOfTransactions, numOfOperations));
 
+    server1.invoke(() -> verifyTransactionAreStarted(numOfTransactions));
+
     unregisterClientMultipleTimes(clientProxyMembershipID);
 
     server1.invoke(() -> verifyTransactionResult(numOfTransactions, numOfOperations, false));
@@ -351,9 +354,9 @@ public class ClientServerTransactionFailoverWithMixedVersionServersDistributedTe
     } else {
       region = cacheRule.getCache().getRegion(regionName);
     }
-    Awaitility.await().atMost(60, TimeUnit.SECONDS)
-        .until(() -> assertThat(region.get(1)).isEqualTo("value1"));
     int numOfEntries = numOfOperations * numOfTransactions;
+    Awaitility.await().atMost(60, TimeUnit.SECONDS)
+        .until(() -> assertThat(region.size()).isEqualTo(numOfEntries));
     for (int i = 1; i <= numOfEntries; i++) {
       LogService.getLogger().info("region get key {} value {} ", i, region.get(i));
     }