HBASE-23999 [flakey test] TestTableOutputFormatConnectionExhaust (#1302)

Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
This commit is contained in:
Huaxiang Sun 2020-03-18 21:51:04 -07:00 committed by GitHub
parent de967502ab
commit 52a04e69c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 10 deletions

View File

@ -19,9 +19,6 @@ package org.apache.hadoop.hbase.regionserver;
import static org.junit.Assert.assertEquals;
import java.io.File;
import java.io.FileOutputStream;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
@ -60,12 +57,6 @@ public class TestCompactionTool {
public void setUp() throws Exception {
this.testUtil.startMiniCluster();
testUtil.createTable(tableName, HBaseTestingUtility.fam1);
String defaultFS = testUtil.getMiniHBaseCluster().getConfiguration().get("fs.defaultFS");
Configuration config = HBaseConfiguration.create();
config.set("fs.defaultFS", defaultFS);
String configPath = this.getClass().getClassLoader()
.getResource("hbase-site.xml").getFile();
config.writeXml(new FileOutputStream(new File(configPath)));
rootDir = testUtil.getDefaultRootDirPath();
this.region = testUtil.getMiniHBaseCluster().getRegions(tableName).get(0);
}
@ -89,7 +80,10 @@ public class TestCompactionTool {
+ Bytes.toString(HBaseTestingUtility.fam1);
FileStatus[] regionDirFiles = fs.listStatus(new Path(storePath));
assertEquals(10, regionDirFiles.length);
int result = ToolRunner.run(HBaseConfiguration.create(), new CompactionTool(),
String defaultFS = testUtil.getMiniHBaseCluster().getConfiguration().get("fs.defaultFS");
Configuration config = HBaseConfiguration.create();
config.set("fs.defaultFS", defaultFS);
int result = ToolRunner.run(config, new CompactionTool(),
new String[]{"-compactOnce", "-major", storePath});
assertEquals(0,result);
regionDirFiles = fs.listStatus(new Path(storePath));