Repository: phoenix
Updated Branches:
refs/heads/4.x-HBase-0.98 4f19820eb -> a4b620560
PHOENIX-1911 Tests could fail if region and wal did not close on windows
(Alicia Ying Shu)
Conflicts:
phoenix-core/src/test/java/org/apache/phoenix/hbase/index/write/recovery/TestPerRegionIndexWriteCache.java
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/a4b62056
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/a4b62056
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/a4b62056
Branch: refs/heads/4.x-HBase-0.98
Commit: a4b620560f6314c6e94108cd0dca6c24c7670673
Parents: 4f19820
Author: Enis Soztutar <[email protected]>
Authored: Mon Apr 27 12:50:44 2015 -0700
Committer: Enis Soztutar <[email protected]>
Committed: Mon Apr 27 13:05:52 2015 -0700
----------------------------------------------------------------------
.../recovery/TestPerRegionIndexWriteCache.java | 22 ++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/a4b62056/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/write/recovery/TestPerRegionIndexWriteCache.java
----------------------------------------------------------------------
diff --git
a/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/write/recovery/TestPerRegionIndexWriteCache.java
b/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/write/recovery/TestPerRegionIndexWriteCache.java
index a3a02ce..0767298 100644
---
a/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/write/recovery/TestPerRegionIndexWriteCache.java
+++
b/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/write/recovery/TestPerRegionIndexWriteCache.java
@@ -24,6 +24,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map.Entry;
+import java.util.Random;
import java.util.Set;
import org.apache.hadoop.fs.FileSystem;
@@ -50,8 +51,8 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
public class TestPerRegionIndexWriteCache {
- private static final HBaseTestingUtility TEST_UTIL = new
HBaseTestingUtility();
- private static final TableName tableName = TableName.valueOf("t1");
+ private static final HBaseTestingUtility TEST_UTIL = new
HBaseTestingUtility();
+ private static TableName tableName = TableName.valueOf("t1");;
private static final byte[] row = Bytes.toBytes("row");
private static final byte[] family = Bytes.toBytes("family");
private static final byte[] qual = Bytes.toBytes("qual");
@@ -66,6 +67,7 @@ public class TestPerRegionIndexWriteCache {
HRegion r1;
HRegion r2;
+ HLog wal;
@SuppressWarnings("deprecation")
@Before
@@ -75,7 +77,9 @@ public class TestPerRegionIndexWriteCache {
HRegionInfo hri = new HRegionInfo(tableName, null, null, false);
Path basedir = FSUtils.getTableDir(hbaseRootDir, tableName);
- HLog wal = HLogFactory.createHLog(newFS,
+ Random rn = new Random();
+ tableName = TableName.valueOf("TestPerRegion" + rn.nextInt());
+ wal = HLogFactory.createHLog(newFS,
hbaseRootDir, "logs", TEST_UTIL.getConfiguration());
HTableDescriptor htd = new HTableDescriptor(tableName);
HColumnDescriptor a = new HColumnDescriptor(Bytes.toBytes("a"));
@@ -108,9 +112,15 @@ public class TestPerRegionIndexWriteCache {
@After
public void cleanUp() throws Exception {
- TEST_UTIL.cleanupTestDir();
+ try{
+ r1.close();
+ r2.close();
+ wal.close();
+ } catch (Exception ignored) {}
+ FileSystem newFS = FileSystem.get(TEST_UTIL.getConfiguration());
+ newFS.delete(TEST_UTIL.getDataTestDir(), true);
}
-
+
@Test
public void testAddRemoveSingleRegion() {
@@ -201,4 +211,4 @@ public class TestPerRegionIndexWriteCache {
// references around to these edits and have a memory leak
assertNull("Got an entry for a region we removed", cache.getEdits(r1));
}
-}
\ No newline at end of file
+}