From 4e5a38eecc447f3cac281c248b9a29d550ceea75 Mon Sep 17 00:00:00 2001 From: Guangxu Cheng Date: Sat, 8 Sep 2018 22:50:50 +0800 Subject: [PATCH] HBASE-21173 Remove the duplicate HRegion#close in TestHRegion --- .../java/org/apache/hadoop/hbase/regionserver/TestHRegion.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java index 2078212a73..b36470f19d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java @@ -283,6 +283,7 @@ public class TestHRegion { long max = region.getMaxFlushedSeqId(); region.close(); assertEquals(max, region.getMaxFlushedSeqId()); + region = null; } /** @@ -314,7 +315,7 @@ public class TestHRegion { // Close with something in memstore and something in the snapshot. Make sure all is cleared. region.close(); assertEquals(0, region.getMemStoreDataSize()); - HBaseTestingUtility.closeRegionAndWAL(region); + region = null; } /* @@ -576,6 +577,7 @@ public class TestHRegion { region.put(p2); // Now try close on top of a failing flush. region.close(); + region = null; fail(); } catch (DroppedSnapshotException dse) { // Expected @@ -1277,6 +1279,7 @@ public class TestHRegion { } finally { if (this.region != null) { HBaseTestingUtility.closeRegionAndWAL(this.region); + this.region = null; } } done.set(true); @@ -1557,6 +1560,7 @@ public class TestHRegion { Thread.sleep(10); startingClose.countDown(); HBaseTestingUtility.closeRegionAndWAL(region); + region = null; } catch (IOException e) { throw new RuntimeException(e); } catch (InterruptedException e) { @@ -4167,7 +4171,6 @@ public class TestHRegion { region = HRegion.openHRegion(rootDir, hri, htd, null, CONF); // region = TEST_UTIL.openHRegion(hri, htd); assertEquals(regionDir, region.getRegionFileSystem().getRegionDir()); - HBaseTestingUtility.closeRegionAndWAL(region); // Verify that the .regioninfo file is still there assertTrue(HRegionFileSystem.REGION_INFO_FILE + " should be present in the region dir", @@ -6230,8 +6233,6 @@ public class TestHRegion { assertTrue(plugins.contains(replicationCoprocessorClass)); assertTrue(region.getCoprocessorHost(). getCoprocessors().contains(ReplicationObserver.class.getSimpleName())); - - region.close(); } /** -- 2.15.1