HBASE-14962 TestSplitWalDataLoss fails on all branches

This commit is contained in:
stack 2016-01-16 15:53:07 -08:00
parent 387eaff316
commit 47fc696bc6
1 changed files with 10 additions and 1 deletions

View File

@ -24,6 +24,7 @@ import static org.mockito.Mockito.spy;
import java.io.IOException; import java.io.IOException;
import java.util.Collection; import java.util.Collection;
import java.util.Map;
import org.apache.commons.lang.mutable.MutableBoolean; import org.apache.commons.lang.mutable.MutableBoolean;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@ -117,7 +118,15 @@ public class TestSplitWalDataLoss {
}).when(spiedRegion).internalFlushCacheAndCommit(Matchers.<WAL> any(), }).when(spiedRegion).internalFlushCacheAndCommit(Matchers.<WAL> any(),
Matchers.<MonitoredTask> any(), Matchers.<PrepareFlushResult> any(), Matchers.<MonitoredTask> any(), Matchers.<PrepareFlushResult> any(),
Matchers.<Collection<Store>> any()); Matchers.<Collection<Store>> any());
rs.onlineRegions.put(rs.onlineRegions.keySet().iterator().next(), spiedRegion); // Find region key; don't pick up key for hbase:meta by mistake.
String key = null;
for (Map.Entry<String, Region> entry: rs.onlineRegions.entrySet()) {
if (entry.getValue().getRegionInfo().getTable().equals(this.tableName)) {
key = entry.getKey();
break;
}
}
rs.onlineRegions.put(key, spiedRegion);
Connection conn = testUtil.getConnection(); Connection conn = testUtil.getConnection();
try (Table table = conn.getTable(tableName)) { try (Table table = conn.getTable(tableName)) {