GEODE-494: remove failing test This test fails very intermittently but doesn't reflect any real-world use case so I'm deleting it.
While debugging, found a logic error in PartitionManager but it seems that the code path is never exercised (used only in tests). Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/e96c960d Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e96c960d Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e96c960d Branch: refs/heads/feature/GEODE-11 Commit: e96c960d658044018be864ccfc81a7cf91e189b2 Parents: cfbeaf2 Author: Jens Deppe <[email protected]> Authored: Mon Nov 9 15:42:42 2015 -0800 Committer: Jens Deppe <[email protected]> Committed: Mon Nov 9 15:42:42 2015 -0800 ---------------------------------------------------------------------- .../cache/partition/PartitionManager.java | 2 +- .../partition/PartitionManagerDUnitTest.java | 75 -------------------- 2 files changed, 1 insertion(+), 76 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e96c960d/gemfire-core/src/main/java/com/gemstone/gemfire/cache/partition/PartitionManager.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/partition/PartitionManager.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/partition/PartitionManager.java index ceff534..8454d2c 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/partition/PartitionManager.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/partition/PartitionManager.java @@ -191,7 +191,7 @@ public final class PartitionManager { logger.debug("createPrimaryBucket: {} bucket {} already primary, destroying local primary", pr, bucketId); } if (dumpBucket(self, region, bucketId)) { - createdBucket = createBucket(self, region, bucketId, destroyExistingRemote); + createdBucket = createBucket(self, region, bucketId, destroyExistingLocal); } } else { if (logger.isDebugEnabled()) { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e96c960d/gemfire-core/src/test/java/com/gemstone/gemfire/cache/partition/PartitionManagerDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/partition/PartitionManagerDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/partition/PartitionManagerDUnitTest.java index e061053..a7696c3 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/partition/PartitionManagerDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/partition/PartitionManagerDUnitTest.java @@ -440,79 +440,4 @@ public class PartitionManagerDUnitTest extends CacheTestCase { }); } - -public void testConcurrentWithPuts() throws Throwable { - - Host host = Host.getHost(0); - VM vm0 = host.getVM(0); - VM vm1 = host.getVM(1); - - SerializableRunnable createPrRegion = new SerializableRunnable("createRegion") { - public void run() - { - Cache cache = getCache(); - AttributesFactory attr = new AttributesFactory(); - PartitionAttributesFactory paf = new PartitionAttributesFactory(); - paf.setRedundantCopies(0); - paf.setRecoveryDelay(-1); - paf.setStartupRecoveryDelay(-1); - PartitionAttributes prAttr = paf.create(); - attr.setPartitionAttributes(prAttr); - cache.createRegion("region1", attr.create()); - } - }; - - vm0.invoke(createPrRegion); - vm1.invoke(createPrRegion); - - SerializableRunnable lotsOfPuts= new SerializableRunnable("A bunch of puts") { - public void run() - { - Cache cache = getCache(); - PartitionedRegion region = (PartitionedRegion) cache.getRegion("region1"); - - long start = System.nanoTime(); - - while(TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start) < CONCURRENT_TIME) { - //Do a put which might trigger bucket creation - region.put(BUCKET_ID, "B"); - try { - Thread.sleep(10); - } catch (InterruptedException e) { - fail("", e); - } - } - } - }; - AsyncInvocation async0_2 = vm0.invokeAsync(lotsOfPuts); - AsyncInvocation async1_2 = vm1.invokeAsync(lotsOfPuts); - - - long start = System.nanoTime(); - - while(TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start) < CONCURRENT_TIME) { - createPrimaryBucket(vm0, true, false); - createPrimaryBucket(vm1, true, false); - } - - async0_2.getResult(MAX_WAIT); - async1_2.getResult(MAX_WAIT); - - vm0.invoke(new SerializableRunnable("Check the number of owners") { - public void run() - { - Cache cache = getCache(); - PartitionedRegion region = (PartitionedRegion) cache.getRegion("region1"); - List owners; - try { - owners = region.getBucketOwnersForValidation(BUCKET_ID); - assertEquals(1, owners.size()); - } catch (ForceReattemptException e) { - fail("shouldn't have seen force reattempt", e); - } - } - }); - - } - }
