Skip to content

Commit

Permalink
GEODE-8191_1: test updated, added bucket initialization after creatio…
Browse files Browse the repository at this point in the history
…n of each child region (apache#5432)
  • Loading branch information
mivanac authored Aug 7, 2020
1 parent 2b86f66 commit ae64bbb
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.apache.geode.management;

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.Serializable;

Expand Down Expand Up @@ -87,25 +87,30 @@ public void testBucketCount() {
server2.invoke(() -> getBucketsInitialized()) +
server3.invoke(() -> getBucketsInitialized()) +
server4.invoke(() -> getBucketsInitialized());
assertEquals("Expected bucket count is 1000, and actual count is " + sumOfBuckets,
sumOfBuckets, 1000);
assertThat(sumOfBuckets).isEqualTo(1000);
});

for (int i = 1; i < 4; i++) {
final String tempRegioName = regionName + i;

gfsh.executeAndAssertThat("create region"
+ " --name=" + regionName + i
+ " --name=" + tempRegioName
+ " --type=PARTITION_PERSISTENT"
+ " --total-num-buckets=1000"
+ " --colocated-with=" + regionName).statusIsSuccess();

server1.invoke(() -> createBuckets(tempRegioName));
server2.invoke(() -> createBuckets(tempRegioName));
server3.invoke(() -> createBuckets(tempRegioName));
server4.invoke(() -> createBuckets(tempRegioName));
}

await().untilAsserted(() -> {
final int sumOfBuckets = server1.invoke(() -> getBucketsInitialized()) +
server2.invoke(() -> getBucketsInitialized()) +
server3.invoke(() -> getBucketsInitialized()) +
server4.invoke(() -> getBucketsInitialized());
assertEquals("Expected bucket count is 4000, and actual count is " + sumOfBuckets,
sumOfBuckets, 4000);
assertThat(sumOfBuckets).isEqualTo(4000);
});

}
Expand Down

0 comments on commit ae64bbb

Please sign in to comment.