You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/06/09 15:53:47 UTC

[GitHub] [geode] jujoramos commented on a change in pull request #5227: GEODE-8191: flaky test correction

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



##########
File path: geode-core/src/distributedTest/java/org/apache/geode/management/MemberMXBeanDistributedTest.java
##########
@@ -104,8 +105,10 @@ public void testBucketCount() {
           server2.invoke(() -> getBucketsInitialized()) +
           server3.invoke(() -> getBucketsInitialized()) +
           server4.invoke(() -> getBucketsInitialized());
-      assertEquals("Expected bucket count is 4000, and actual count is " + sumOfBuckets,
-          sumOfBuckets, 4000);
+      assertTrue("Expected bucket count is greather than 3500, and actual count is " + sumOfBuckets,
+          sumOfBuckets > 3500);

Review comment:
       I believe this change just "hides" the flakiness. If we are expecting a deterministic bucket count between all members, we should find a way to wait for the condition to become true and directly assert that as we were doing before.

##########
File path: geode-core/src/distributedTest/java/org/apache/geode/management/MemberMXBeanDistributedTest.java
##########
@@ -104,8 +105,10 @@ public void testBucketCount() {
           server2.invoke(() -> getBucketsInitialized()) +
           server3.invoke(() -> getBucketsInitialized()) +
           server4.invoke(() -> getBucketsInitialized());
-      assertEquals("Expected bucket count is 4000, and actual count is " + sumOfBuckets,
-          sumOfBuckets, 4000);
+      assertTrue("Expected bucket count is greather than 3500, and actual count is " + sumOfBuckets,
+          sumOfBuckets > 3500);

Review comment:
       Understood, but I still don't think this is the right fix: we're just "masking" the issue, not solving it. The test is creating two partition regions, each one is configured to have `1000` buckets and `1` redundant copy, so the test should assert that we end up having `4000` buckets, not some value higher than `3750`.
   If we don't fix the race condition within the test, in some time we might see the same failure just because the bucket count is lower than `3750`.




----------------------------------------------------------------
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:
users@infra.apache.org