[ https://issues.apache.org/jira/browse/GEODE-8748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17241781#comment-17241781 ]
ASF GitHub Bot commented on GEODE-8748: --------------------------------------- DonalEvans commented on a change in pull request #5790: URL: https://github.com/apache/geode/pull/5790#discussion_r533641921 ########## File path: geode-gfsh/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/AlterTimeToLiveExpirationOnProxyRegionDUnitTest.java ########## @@ -0,0 +1,74 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.apache.geode.management.internal.cli.commands; + +import junitparams.JUnitParamsRunner; +import junitparams.Parameters; +import junitparams.naming.TestCaseName; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.runner.RunWith; + +import org.apache.geode.test.dunit.rules.ClusterStartupRule; +import org.apache.geode.test.dunit.rules.MemberVM; +import org.apache.geode.test.junit.categories.EvictionTest; +import org.apache.geode.test.junit.rules.GfshCommandRule; + +@Category({EvictionTest.class}) +@RunWith(JUnitParamsRunner.class) +public class AlterTimeToLiveExpirationOnProxyRegionDUnitTest { + @Rule + public ClusterStartupRule clusterStartupRule = new ClusterStartupRule(); + @Rule + public GfshCommandRule gfsh = new GfshCommandRule(); + + public Object[] getRegionTypePairs() { + return new Object[] { + new Object[] {"REPLICATE", "REPLICATE_PROXY"}, + new Object[] {"PARTITION", "PARTITION_PROXY"}, + new Object[] {"PARTITION_REDUNDANT", "PARTITION_PROXY_REDUNDANT"} + }; + } + + @Test + @Parameters(method = "getRegionTypePairs") + @TestCaseName("[{index}] {method} Non Proxy Region Type:{0}; Proxy Region Type:{1}") + public void whenExpirationIsSetUsingAlterOnProxyRegionThenItShouldNotThrowException( + String nonProxyRegionType, String proxyRegionType) throws Exception { + MemberVM locator = clusterStartupRule.startLocatorVM(0); + MemberVM server1 = clusterStartupRule.startServerVM(1, "non-proxy", locator.getPort()); + MemberVM server2 = clusterStartupRule.startServerVM(2, "proxy", locator.getPort()); Review comment: These variables are assigned but never used. ---------------------------------------------------------------- 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 > Altering expiry time on proxy region causes NPE > ----------------------------------------------- > > Key: GEODE-8748 > URL: https://issues.apache.org/jira/browse/GEODE-8748 > Project: Geode > Issue Type: Task > Components: expiration > Reporter: Nabarun Nag > Priority: Major > Labels: pull-request-available > > When we execute > "create region --name=region --type=PARTITION_PROXY --group=proxy" > "alter region --name=region --entry-time-to-live-expiration=1000 > --entry-time-to-live-expiration-action=destroy --group=proxy" > > This results in an NPE. Also if there is a mixture of proxy and non-proxy > versions of the same region and we could alter some of the non-proxy but the > proxy region failed on alter commands, then restarts will start encountering > problems. -- This message was sent by Atlassian Jira (v8.3.4#803005)