From 58727343f2b7ac4093828ca645084901d7ca568c Mon Sep 17 00:00:00 2001 From: Enis Soztutar Date: Tue, 15 Jul 2014 18:28:32 -0700 Subject: [PATCH] HBASE-11511 Write flush events to WAL (ADDENDUM to fix flaky test) --- .../apache/hadoop/hbase/regionserver/TestHRegion.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 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 6e050a088a6..0f9de92b0c8 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 @@ -798,8 +798,8 @@ public class TestHRegion { String method = name.getMethodName(); TableName tableName = TableName.valueOf(method); byte[] family = Bytes.toBytes("family"); - Path logDir = TEST_UTIL.getDataTestDirOnTestFS("testRecoveredEditsIgnoreFlushMarkers.log"); - HLog hlog = HLogFactory.createHLog(FILESYSTEM, logDir, UUID.randomUUID().toString(), + Path logDir = TEST_UTIL.getDataTestDirOnTestFS(method + ".log"); + HLog hlog = HLogFactory.createHLog(FILESYSTEM, logDir, "logs", TEST_UTIL.getConfiguration()); this.region = initHRegion(tableName.getName(), HConstants.EMPTY_START_ROW, @@ -829,7 +829,7 @@ public class TestHRegion { // now verify that the flush markers are written hlog.close(); HLog.Reader reader = HLogFactory.createReader(fs, - fs.listStatus(fs.listStatus(logDir)[0].getPath())[0].getPath(), + fs.listStatus(new Path(logDir, "logs"))[0].getPath(), TEST_UTIL.getConfiguration()); List flushDescriptors = new ArrayList(); @@ -942,8 +942,9 @@ public class TestHRegion { byte[] family = Bytes.toBytes("family"); // spy an actual WAL implementation to throw exception (was not able to mock) - Path logDir = TEST_UTIL.getDataTestDirOnTestFS("testRecoveredEditsIgnoreFlushMarkers.log"); - HLog hlog = spy(HLogFactory.createHLog(FILESYSTEM, logDir, UUID.randomUUID().toString(), + Path logDir = TEST_UTIL.getDataTestDirOnTestFS(method + "log"); + + HLog hlog = spy(HLogFactory.createHLog(FILESYSTEM, logDir, "logs", TEST_UTIL.getConfiguration())); this.region = initHRegion(tableName.getName(), HConstants.EMPTY_START_ROW,