[
https://issues.apache.org/jira/browse/GEODE-7115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16946163#comment-16946163
]
Darrel Schneider commented on GEODE-7115:
-----------------------------------------
It looks like what is flaky here is that after you create a region its mbean
may not be available right after the gfsh command returns.
This test does this:
{code:java}
gfsh.executeAndAssertThat("create region"
+ " --name=" + regionName
+ " --type=PARTITION_REDUNDANT").statusIsSuccess();
{code}
and then immediately does this:
{code:java}
gfsh.executeAndAssertThat("create region"
+ " --name=" + colocatedRegionName
+ " --colocated-with=" + regionName
+ " --type=PARTITION_REDUNDANT").statusIsSuccess();
{code}
The second one fails because it think the first region (named on
--colocated-with) does not exist.
The way it checks for existence is:
{code:java}
DistributedRegionMXBean colocatedRegionBean =
getManagementService().getDistributedRegionMXBean(prColocatedWith);
if (colocatedRegionBean == null) {
{code}
The code that is checking for the beens existence runs on the locator. So the
async part might be in this "federated" bean being pushed from the server that
created the region to the locator were this check is done.
The test could be changed to no longer fail by having some retry logic. But I
think in this case it is reasonable to expect the product to know that a
regions exists after you have successfully created one. I think we should fix
this by changing the product to do a better check. I think if we removed this
check from
org.apache.geode.management.internal.cli.commands.CreateRegionCommand.createRegion()
then eventually the check will be done by the core on the server when you
actually create the region in the internal function. So one option is to just
allow the core to do this check instead of trying to do it based on beans on
the locator. The locator could also look for the region in cluster config (if
it is enabled) which should not have a race. Or the locator could do some
retries waiting for the bean to show up.
> CI Failure: CreateRegionCommandPersistsConfigurationDUnitTest >
> createRegionWithColocation
> ------------------------------------------------------------------------------------------
>
> Key: GEODE-7115
> URL: https://issues.apache.org/jira/browse/GEODE-7115
> Project: Geode
> Issue Type: Bug
> Components: management
> Reporter: Donal Evans
> Priority: Major
> Labels: flaky
>
> https://concourse.apachegeode-ci.info/teams/main/pipelines/apache-develop-main/jobs/DistributedTestOpenJDK8/builds/1015
> org.apache.geode.management.internal.cli.commands.CreateRegionCommandPersistsConfigurationDUnitTest
> > createRegionWithColocation FAILED
> org.junit.ComparisonFailure: [Specify a valid region path for
> colocated-with. Region /createRegionWithColocation not found.
> ] expected:<[OK]> but was:<[ERROR]>
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at
> org.apache.geode.test.junit.assertions.CommandResultAssert.statusIsSuccess(CommandResultAssert.java:104)
> at
> org.apache.geode.management.internal.cli.commands.CreateRegionCommandPersistsConfigurationDUnitTest.createRegionWithColocation(CreateRegionCommandPersistsConfigurationDUnitTest.java:442)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)