jujoramos commented on a change in pull request #5227:
URL: https://github.com/apache/geode/pull/5227#discussion_r440233185



##########
File path: 
geode-core/src/distributedTest/java/org/apache/geode/management/MemberMXBeanDistributedTest.java
##########
@@ -82,16 +82,19 @@ public void testBucketCount() {
     server3.invoke(() -> createBuckets(regionName));
     server4.invoke(() -> createBuckets(regionName));
 
-    await().untilAsserted(() -> {
-      final int sumOfBuckets = server1.invoke(() -> getBucketsInitialized()) +
-          server2.invoke(() -> getBucketsInitialized()) +
-          server3.invoke(() -> getBucketsInitialized()) +
-          server4.invoke(() -> getBucketsInitialized());
-      assertEquals("Expected bucket count is 1000, and actual count is " + 
sumOfBuckets,
-          sumOfBuckets, 1000);
-    });
-
     for (int i = 1; i < 4; i++) {
+
+      final int index = i;
+      await().untilAsserted(() -> {
+        final int sumOfBuckets = server1.invoke(() -> getBucketsInitialized()) 
+
+            server2.invoke(() -> getBucketsInitialized()) +
+            server3.invoke(() -> getBucketsInitialized()) +
+            server4.invoke(() -> getBucketsInitialized());
+        final int expectedBuckets = index * 1000;
+        assertThat(sumOfBuckets).isEqualTo(expectedBuckets);
+
+      });

Review comment:
       According to what I see in the last 4 failures within the `CI` for this 
test, the actual assertion failure happens when we expect 4000 as the total 
buckets (later in the test), not here:
   
   - 
https://concourse.apachegeode-ci.info/teams/main/pipelines/apache-develop-main/jobs/DistributedTestOpenJDK11/builds/205
   - 
https://concourse.apachegeode-ci.info/teams/main/pipelines/apache-develop-main/jobs/DistributedTestOpenJDK11/builds/219
   - 
https://concourse.apachegeode-ci.info/teams/main/pipelines/apache-develop-main/jobs/DistributedTestOpenJDK11/builds/234
   - 
https://concourse.apachegeode-ci.info/teams/main/pipelines/apache-develop-main/jobs/DistributedTestOpenJDK11/builds/249
   
   > If there were no pause between region creation.
   
   What do you mean?, if we optimistically hope for the region creation to be 
completed within the loop we might hit more flakiness. Instead, we should add 
some logic to double check that all operations have finished on the servers 
before executing the assertions. The following might help:
   
   ```
     private void waitForSilence() {
       DMStats dmStats = 
cacheRule.getSystem().getDistributionManager().getStats();
       PartitionedRegion region = (PartitionedRegion) 
cacheRule.getCache().getRegion(REGION_NAME);
       PartitionedRegionStats partitionedRegionStats = region.getPrStats();
   
       await().untilAsserted(() -> {
         assertThat(dmStats.getReplyWaitsInProgress()).isEqualTo(0);
         
assertThat(partitionedRegionStats.getVolunteeringInProgress()).isEqualTo(0);
         
assertThat(partitionedRegionStats.getBucketCreatesInProgress()).isEqualTo(0);
         
assertThat(partitionedRegionStats.getPrimaryTransfersInProgress()).isEqualTo(0);
         
assertThat(partitionedRegionStats.getRebalanceBucketCreatesInProgress()).isEqualTo(0);
         
assertThat(partitionedRegionStats.getRebalancePrimaryTransfersInProgress()).isEqualTo(0);
       });
     }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to