HBASE-25773 TestSnapshotScannerHDFSAclController.setupBeforeClass is flaky (#3651)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 345d7256c8)
This commit is contained in:
XinSun 2021-09-01 18:43:25 +08:00 committed by sunxin
parent e07928df4c
commit ccd90269d2
2 changed files with 8 additions and 14 deletions

View File

@ -44,7 +44,6 @@ import org.apache.hadoop.hbase.client.TableDescriptor;
import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
import org.apache.hadoop.hbase.coprocessor.CoprocessorHost;
import org.apache.hadoop.hbase.master.cleaner.HFileCleaner;
import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility;
import org.apache.hadoop.hbase.security.User;
import org.apache.hadoop.hbase.testclassification.LargeTests;
import org.apache.hadoop.hbase.testclassification.SecurityTests;
@ -99,9 +98,11 @@ public class TestSnapshotScannerHDFSAclController {
+ SnapshotScannerHDFSAclController.class.getName());
TEST_UTIL.startMiniCluster();
ProcedureTestingUtility.waitAllProcedures(
TEST_UTIL.getMiniHBaseCluster().getMaster().getMasterProcedureExecutor());
SnapshotScannerHDFSAclController coprocessor = TEST_UTIL.getHBaseCluster().getMaster()
.getMasterCoprocessorHost().findCoprocessor(SnapshotScannerHDFSAclController.class);
TEST_UTIL.waitFor(30000, () -> coprocessor.checkInitialized("check initialized"));
TEST_UTIL.waitTableAvailable(PermissionStorage.ACL_TABLE_NAME);
admin = TEST_UTIL.getAdmin();
rootDir = TEST_UTIL.getDefaultRootDirPath();
FS = rootDir.getFileSystem(conf);
@ -131,10 +132,6 @@ public class TestSnapshotScannerHDFSAclController {
FS.setPermission(path, commonDirectoryPermission);
path = path.getParent();
}
SnapshotScannerHDFSAclController coprocessor = TEST_UTIL.getHBaseCluster().getMaster()
.getMasterCoprocessorHost().findCoprocessor(SnapshotScannerHDFSAclController.class);
TEST_UTIL.waitFor(1200000, () -> coprocessor.checkInitialized("check initialized"));
aclTable = admin.getConnection().getTable(PermissionStorage.ACL_TABLE_NAME);
}

View File

@ -32,7 +32,6 @@ import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.coprocessor.CoprocessorHost;
import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility;
import org.apache.hadoop.hbase.security.User;
import org.apache.hadoop.hbase.testclassification.LargeTests;
import org.apache.hadoop.hbase.testclassification.SecurityTests;
@ -86,9 +85,11 @@ public class TestSnapshotScannerHDFSAclController2 {
+ SnapshotScannerHDFSAclController.class.getName());
TEST_UTIL.startMiniCluster();
ProcedureTestingUtility.waitAllProcedures(
TEST_UTIL.getMiniHBaseCluster().getMaster().getMasterProcedureExecutor());
SnapshotScannerHDFSAclController coprocessor = TEST_UTIL.getHBaseCluster().getMaster()
.getMasterCoprocessorHost().findCoprocessor(SnapshotScannerHDFSAclController.class);
TEST_UTIL.waitFor(30000, () -> coprocessor.checkInitialized("check initialized"));
TEST_UTIL.waitTableAvailable(PermissionStorage.ACL_TABLE_NAME);
admin = TEST_UTIL.getAdmin();
Path rootDir = TEST_UTIL.getDefaultRootDirPath();
FS = rootDir.getFileSystem(conf);
@ -118,10 +119,6 @@ public class TestSnapshotScannerHDFSAclController2 {
FS.setPermission(path, commonDirectoryPermission);
path = path.getParent();
}
SnapshotScannerHDFSAclController coprocessor = TEST_UTIL.getHBaseCluster().getMaster()
.getMasterCoprocessorHost().findCoprocessor(SnapshotScannerHDFSAclController.class);
TEST_UTIL.waitFor(1200000, () -> coprocessor.checkInitialized("check initialized"));
aclTable = admin.getConnection().getTable(PermissionStorage.ACL_TABLE_NAME);
}