ringles commented on a change in pull request #5978: URL: https://github.com/apache/geode/pull/5978#discussion_r569489876
########## File path: geode-core/src/distributedTest/java/org/apache/geode/internal/cache/DeltaForceSizingFlagDUnitTest.java ########## @@ -0,0 +1,995 @@ +/* + * 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.internal.cache; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.File; +import java.io.IOException; +import java.util.Random; +import java.util.concurrent.atomic.AtomicInteger; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +import org.apache.geode.DataSerializable; +import org.apache.geode.DataSerializer; +import org.apache.geode.cache.AttributesFactory; +import org.apache.geode.cache.Cache; +import org.apache.geode.cache.DataPolicy; +import org.apache.geode.cache.EntryEvent; +import org.apache.geode.cache.EvictionAction; +import org.apache.geode.cache.EvictionAttributes; +import org.apache.geode.cache.InterestPolicy; +import org.apache.geode.cache.PartitionAttributes; +import org.apache.geode.cache.PartitionAttributesFactory; +import org.apache.geode.cache.Region; +import org.apache.geode.cache.Scope; +import org.apache.geode.cache.SubscriptionAttributes; +import org.apache.geode.cache.control.ResourceManager; +import org.apache.geode.cache.partition.PartitionRegionHelper; +import org.apache.geode.cache.util.CacheListenerAdapter; +import org.apache.geode.cache.util.ObjectSizer; +import org.apache.geode.distributed.DistributedMember; +import org.apache.geode.distributed.internal.InternalDistributedSystem; +import org.apache.geode.test.dunit.Assert; +import org.apache.geode.test.dunit.VM; +import org.apache.geode.test.dunit.rules.ClusterStartupRule; +import org.apache.geode.test.dunit.rules.MemberVM; + +/** + * Tests the use of the per-delta "forceRecalculateSize" flag. + */ + +public class DeltaForceSizingFlagDUnitTest { + + @Rule + public ClusterStartupRule cluster = new ClusterStartupRule(); + + protected MemberVM locator; + protected MemberVM server1; + protected MemberVM server2; + + @Before + public void setup() { + int locatorPort; + locator = cluster.startLocatorVM(0); + locatorPort = locator.getPort(); + + server1 = cluster.startServerVM(1, locatorPort); + server2 = cluster.startServerVM(2, locatorPort); + } + + @Test + public void testRRMemLRU() { + doRRMemLRUTest(); + } + + @Test + public void testRRMemLRUDeltaAndFlag() { + doRRMemLRUDeltaTest(true); + } + + @Test + public void testRRMemLRUDelta() { + doRRMemLRUDeltaTest(false); + } + + @Test + public void testRRListener() { + createRR(server1); + createRR(server2); + + addListener(server1); + addListener(server2); + + doListenerTestRR(server1.getVM(), server2.getVM()); + } + + @Test + public void testPRMemLRU() { + doPRMemLRUTest(); + } + + @Test + public void testPRMemLRUAndFlagDeltaPutOnPrimary() { + doPRDeltaTestLRU(false, false, true, false); + } + + @Test + public void testPRMemLRUDeltaPutOnPrimary() { + doPRDeltaTestLRU(false, false, true, false); + } + + @Test + public void testPRMemLRUAndFlagDeltaPutOnSecondary() { + doPRDeltaTestLRU(false, false, false, true); + } + + @Test + public void testPRMemLRUDeltaPutOnSecondary() { + doPRDeltaTestLRU(false, false, false, true); + } + + @Test + public void testPRNoLRUDelta() { + doPRNoLRUDeltaTest(false); + } + + @Test + public void testPRNoLRUAndFlagDelta() { + doPRNoLRUDeltaTest(true); + } + + @Test + public void testPRListener() { + createPR(server1, true); + createPR(server2, true); + + addListener(server1); + addListener(server2); + + doListenerTestPR(server1.getVM(), server2.getVM()); + } + + @Test + public void testPRHeapLRU() { Review comment: Some of this is in order to ensure that the existence of forceRecalculateSize flag doesn't screw up other sizing calculations by accident. But since it's being tested in SizingFlagDUnitTest, we can lose it here. ---------------------------------------------------------------- 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: [email protected]
