Source:
public void testRebalanceResultOutputMemberCountWithColocatedRegions() throws Exception { MemberVM locator = cluster.startLocatorVM(0); MemberVM server1 = cluster.startServerVM(1, locator.getPort()); MemberVM server2 = cluster.startServerVM(2, locator.getPort()); server1.invoke(() -> { Region<Object, Object> parentRegion = Objects.requireNonNull(ClusterStartupRule.getCache()) .createRegionFactory(RegionShortcut.PARTITION).create(PARENT_REGION_NAME); IntStream.range(0, 500).forEach(i -> parentRegion.put("key" + i, "value" + 1)); PartitionAttributesImpl attributes = new PartitionAttributesImpl(); attributes.setColocatedWith(PARENT_REGION_NAME); Region<Object, Object> childRegion = Objects.requireNonNull(ClusterStartupRule.getCache()) .createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(attributes) .create(CHILD_REGION_NAME); IntStream.range(0, 500).forEach(i -> childRegion.put("key" + i, "value" + 1)); }); server2.invoke(() -> { Objects.requireNonNull(ClusterStartupRule.getCache()) .createRegionFactory(RegionShortcut.PARTITION).create(PARENT_REGION_NAME); PartitionAttributesImpl attributes = new PartitionAttributesImpl(); attributes.setColocatedWith(PARENT_REGION_NAME); Objects.requireNonNull(ClusterStartupRule.getCache()) .createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(attributes) .create(CHILD_REGION_NAME); }); locator.waitUntilRegionIsReadyOnExactlyThisManyServers("/" + PARENT_REGION_NAME, 2); locator.waitUntilRegionIsReadyOnExactlyThisManyServers("/" + CHILD_REGION_NAME, 2); gfsh.connectAndVerify(locator); Map<String, List<String>> rebalanceResult = gfsh.executeAndAssertThat("rebalance") .statusIsSuccess().hasTableSection().getActual().getContent(); assertThat(rebalanceResult.get("Value").get(9)).isEqualTo("2"); }

Target:
public void testRebalanceResultOutputMemberCountWithColocatedRegions() throws Exception { MemberVM locator = cluster.startLocatorVM(0); MemberVM server1 = cluster.startServerVM(1, locator.getPort()); MemberVM server2 = cluster.startServerVM(2, locator.getPort()); server1.invoke(() -> { Region<Object, Object> parentRegion = Objects.requireNonNull(ClusterStartupRule.getCache()) .createRegionFactory(RegionShortcut.PARTITION).create(PARENT_REGION_NAME); IntStream.range(0, 500).forEach(i -> parentRegion.put("key" + i, "value" + 1)); PartitionAttributesImpl attributes = new PartitionAttributesImpl(); attributes.setColocatedWith(PARENT_REGION_NAME); Region<Object, Object> childRegion = Objects.requireNonNull(ClusterStartupRule.getCache()) .createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(attributes) .create(CHILD_REGION_NAME); IntStream.range(0, 500).forEach(i -> childRegion.put("key" + i, "value" + 1)); }); server2.invoke(() -> { Objects.requireNonNull(ClusterStartupRule.getCache()) .createRegionFactory(RegionShortcut.PARTITION).create(PARENT_REGION_NAME); PartitionAttributesImpl attributes = new PartitionAttributesImpl(); attributes.setColocatedWith(PARENT_REGION_NAME); Objects.requireNonNull(ClusterStartupRule.getCache()) .createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(attributes) .create(CHILD_REGION_NAME); }); locator.waitUntilRegionIsReadyOnExactlyThisManyServers("/" + PARENT_REGION_NAME, 2); locator.waitUntilRegionIsReadyOnExactlyThisManyServers("/" + CHILD_REGION_NAME, 2); gfsh.connectAndVerify(locator); Map<String, List<String>> rebalanceResult = gfsh.executeAndAssertThat("rebalance --include-region=/" + PARENT_REGION_NAME) .statusIsSuccess().hasTableSection().getActual().getContent(); assertThat(rebalanceResult.get("Value").get(9)).isEqualTo("2"); }