From 63d617a0ccabd6bc4c921f7b70a3ff3f83a245b1 Mon Sep 17 00:00:00 2001 From: tedyu Date: Thu, 28 May 2015 19:30:36 -0700 Subject: [PATCH] HBASE-13800 TestStore#testDeleteExpiredStoreFiles should create unique data/log directory for each call (Stephen Jiang) --- .../org/apache/hadoop/hbase/regionserver/TestStore.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java index 3adef9d45b5..a1a58bce15d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java @@ -307,7 +307,7 @@ public class TestStore { HColumnDescriptor hcd = new HColumnDescriptor(family); hcd.setMinVersions(minVersions); hcd.setTimeToLive(ttl); - init(name.getMethodName(), conf, hcd); + init(name.getMethodName() + "-" + minVersions, conf, hcd); long storeTtl = this.store.getScanInfo().getTtl(); long sleepTime = storeTtl / storeFileNum; @@ -347,6 +347,7 @@ public class TestStore { edge.incrementTime(sleepTime); } assertNull(this.store.requestCompaction()); + Collection sfs = this.store.getStorefiles(); // Assert the last expired file is not removed. if (minVersions == 0) { @@ -354,6 +355,10 @@ public class TestStore { } long ts = sfs.iterator().next().getReader().getMaxTimestamp(); assertTrue(ts < (edge.currentTime() - storeTtl)); + + for (StoreFile sf : sfs) { + sf.closeReader(true); + } } @Test