You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bo...@apache.org on 2021/05/28 00:00:14 UTC

[geode] branch feature/GEODE-9299 created (now 9f95797)

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

boglesby pushed a change to branch feature/GEODE-9299
in repository https://gitbox.apache.org/repos/asf/geode.git.


      at 9f95797  GEODE-9299: Assert greater than or equal instead of equals

This branch includes the following new commits:

     new 9f95797  GEODE-9299: Assert greater than or equal instead of equals

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[geode] 01/01: GEODE-9299: Assert greater than or equal instead of equals

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

boglesby pushed a commit to branch feature/GEODE-9299
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 9f95797c1a9ddd8529007b1b9d4099c9e5cbf09a
Author: Barry Oglesby <bo...@pivotal.io>
AuthorDate: Thu May 27 16:57:54 2021 -0700

    GEODE-9299: Assert greater than or equal instead of equals
---
 .../org/apache/geode/cache/wan/WANRollingUpgradeDUnitTest.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/geode-wan/src/upgradeTest/java/org/apache/geode/cache/wan/WANRollingUpgradeDUnitTest.java b/geode-wan/src/upgradeTest/java/org/apache/geode/cache/wan/WANRollingUpgradeDUnitTest.java
index 6d72941..2f5608d 100644
--- a/geode-wan/src/upgradeTest/java/org/apache/geode/cache/wan/WANRollingUpgradeDUnitTest.java
+++ b/geode-wan/src/upgradeTest/java/org/apache/geode/cache/wan/WANRollingUpgradeDUnitTest.java
@@ -27,7 +27,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATO
 import static org.apache.geode.distributed.ConfigurationProperties.USE_CLUSTER_CONFIGURATION;
 import static org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPort;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
-import static org.junit.Assert.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.IOException;
 import java.util.Collection;
@@ -216,7 +216,7 @@ public abstract class WANRollingUpgradeDUnitTest extends JUnit4CacheTestCase {
     // Verify remote site received events
     int remoteServer1EventsReceived = remoteServer1.invoke(() -> getEventsReceived(regionName));
     int remoteServer2EventsReceived = remoteServer2.invoke(() -> getEventsReceived(regionName));
-    assertEquals(numPuts, remoteServer1EventsReceived + remoteServer2EventsReceived);
+    assertThat(remoteServer1EventsReceived + remoteServer2EventsReceived).isEqualTo(numPuts);
 
     // Clear events received in both sites
     localServer1.invoke(() -> clearEventsReceived(regionName));
@@ -230,7 +230,9 @@ public abstract class WANRollingUpgradeDUnitTest extends JUnit4CacheTestCase {
     // Verify the secondary events still exist
     int localServer1QueueSize = localServer1.invoke(() -> getQueueRegionSize(senderId, false));
     int localServer2QueueSize = localServer2.invoke(() -> getQueueRegionSize(senderId, false));
-    assertEquals(numPuts, localServer1QueueSize + localServer2QueueSize);
+    // The actual number of events in the queues can be greater than the number of puts in the case
+    // of a client timeout / failover
+    assertThat(localServer1QueueSize + localServer2QueueSize).isGreaterThanOrEqualTo(numPuts);
 
     // Stop one sender
     localServer1.invoke(() -> closeCache());
@@ -242,7 +244,7 @@ public abstract class WANRollingUpgradeDUnitTest extends JUnit4CacheTestCase {
     // all members, so there should be 0 events received on the remote site.
     int remoteServer1EventsReceived = remoteServer1.invoke(() -> getEventsReceived(regionName));
     int remoteServer2EventsReceived = remoteServer2.invoke(() -> getEventsReceived(regionName));
-    assertEquals(0, remoteServer1EventsReceived + remoteServer2EventsReceived);
+    assertThat(remoteServer1EventsReceived + remoteServer2EventsReceived).isEqualTo(0);
   }
 
   String getCreateGatewaySenderCommand(String id, int remoteDsId) {