HBASE-13744 TestCorruptedRegionStoreFile is flaky
This commit is contained in:
parent
83f5663a22
commit
39c0b8f6db
|
@ -28,6 +28,7 @@ import org.apache.hadoop.fs.FileSystem;
|
|||
import org.apache.hadoop.fs.Path;
|
||||
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
||||
import org.apache.hadoop.hbase.TableName;
|
||||
import org.apache.hadoop.hbase.client.HTable;
|
||||
import org.apache.hadoop.hbase.client.Scan;
|
||||
import org.apache.hadoop.hbase.client.Result;
|
||||
import org.apache.hadoop.hbase.client.ResultScanner;
|
||||
|
@ -50,9 +51,7 @@ import org.junit.Test;
|
|||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
@Category({MasterTests.class, LargeTests.class})
|
||||
public class TestCorruptedRegionStoreFile {
|
||||
|
@ -63,7 +62,7 @@ public class TestCorruptedRegionStoreFile {
|
|||
private static final String FAMILY_NAME_STR = "f";
|
||||
private static final byte[] FAMILY_NAME = Bytes.toBytes(FAMILY_NAME_STR);
|
||||
|
||||
private static final int NUM_FILES = 25;
|
||||
private static final int NUM_FILES = 10;
|
||||
private static final int ROW_PER_FILE = 2000;
|
||||
private static final int NUM_ROWS = NUM_FILES * ROW_PER_FILE;
|
||||
|
||||
|
@ -74,9 +73,9 @@ public class TestCorruptedRegionStoreFile {
|
|||
private int rowCount;
|
||||
|
||||
private static void setupConf(Configuration conf) {
|
||||
conf.setLong("hbase.hstore.compaction.min", 20);
|
||||
conf.setLong("hbase.hstore.compaction.max", 39);
|
||||
conf.setLong("hbase.hstore.blockingStoreFiles", 40);
|
||||
// Disable compaction so the store file count stays constant
|
||||
conf.setLong("hbase.hstore.compactionThreshold", NUM_FILES + 1);
|
||||
conf.setLong("hbase.hstore.blockingStoreFiles", NUM_FILES * 2);
|
||||
}
|
||||
|
||||
private void setupTable(final TableName tableName) throws IOException {
|
||||
|
@ -94,6 +93,7 @@ public class TestCorruptedRegionStoreFile {
|
|||
|
||||
if ((rowCount++ % ROW_PER_FILE) == 0) {
|
||||
// flush it
|
||||
((HTable)table).flushCommits();
|
||||
UTIL.getHBaseAdmin().flush(tableName);
|
||||
}
|
||||
}
|
||||
|
@ -115,8 +115,8 @@ public class TestCorruptedRegionStoreFile {
|
|||
storeFiles.add(link.getOriginPath());
|
||||
}
|
||||
});
|
||||
assertTrue("expected at least 1 store file", storeFiles.size() > 0);
|
||||
LOG.info("store-files: " + storeFiles);
|
||||
assertTrue("Expected at least " + NUM_FILES + " store files", storeFiles.size() >= NUM_FILES);
|
||||
LOG.info("Store files: " + storeFiles);
|
||||
}
|
||||
|
||||
@Before
|
||||
|
|
Loading…
Reference in New Issue