[ 
https://issues.apache.org/jira/browse/GEODE-8191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17136085#comment-17136085
 ] 

ASF GitHub Bot commented on GEODE-8191:
---------------------------------------

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



##########
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:
       The change to wait within the loop might help, I'm not arguing that, but 
I still don't think that it will fix the flakiness; it also clutters the test 
class a lot.
   I believe the proper fix would be to force the bucket creation 
(`PartitionRegionHelper.assignBucketsToPartitions`) within the loop after each 
region is created, as you're already doing for the initial region 
(`testCreateRegion`).




----------------------------------------------------------------
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


> MemberMXBeanDistributedTest.testBucketCount fails intermittently
> ----------------------------------------------------------------
>
>                 Key: GEODE-8191
>                 URL: https://issues.apache.org/jira/browse/GEODE-8191
>             Project: Geode
>          Issue Type: Bug
>          Components: jmx, tests
>            Reporter: Kirk Lund
>            Assignee: Mario Ivanac
>            Priority: Major
>              Labels: flaky
>
> This appears to be a flaky test related to GEODE-7963 which was resolved by 
> Mario Ivanac so I've assigned the ticket to him.
> {noformat}
> org.apache.geode.management.MemberMXBeanDistributedTest > testBucketCount 
> FAILED
>     org.awaitility.core.ConditionTimeoutException: Assertion condition 
> defined as a lambda expression in 
> org.apache.geode.management.MemberMXBeanDistributedTest Expected bucket count 
> is 4000, and actual count is 3750 expected:<3750> but was:<4000> within 5 
> minutes.
>         at 
> org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:165)
>         at 
> org.awaitility.core.AssertionCondition.await(AssertionCondition.java:119)
>         at 
> org.awaitility.core.AssertionCondition.await(AssertionCondition.java:31)
>         at 
> org.awaitility.core.ConditionFactory.until(ConditionFactory.java:895)
>         at 
> org.awaitility.core.ConditionFactory.untilAsserted(ConditionFactory.java:679)
>         at 
> org.apache.geode.management.MemberMXBeanDistributedTest.testBucketCount(MemberMXBeanDistributedTest.java:102)
>         Caused by:
>         java.lang.AssertionError: Expected bucket count is 4000, and actual 
> count is 3750 expected:<3750> but was:<4000>
>             at org.junit.Assert.fail(Assert.java:88)
>             at org.junit.Assert.failNotEquals(Assert.java:834)
>             at org.junit.Assert.assertEquals(Assert.java:645)
>             at 
> org.apache.geode.management.MemberMXBeanDistributedTest.lambda$testBucketCount$1(MemberMXBeanDistributedTest.java:107)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to