HBASE-26364 TestThriftServer is failing 100% in our flaky test job (#3759)

Signed-off-by: Xiaolin Ha <haxiaolin@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 4454c2f909)
This commit is contained in:
Wellington Ramos Chevreuil 2021-10-18 13:59:42 +01:00 committed by Wellington Chevreuil
parent 533f53587a
commit 7bbbd3dafc
1 changed files with 30 additions and 27 deletions

View File

@ -774,6 +774,7 @@ public class TestThriftServer {
String col = "c";
// create a table which will throw exceptions for requests
final TableName tableName = TableName.valueOf(name.getMethodName());
try {
HTableDescriptor tableDesc = new HTableDescriptor(tableName);
tableDesc.addCoprocessor(ErrorThrowingGetObserver.class.getName());
tableDesc.addFamily(new HColumnDescriptor(family));
@ -786,8 +787,7 @@ public class TestThriftServer {
Configuration conf = UTIL.getConfiguration();
ThriftMetrics metrics = getMetrics(conf);
ThriftHBaseServiceHandler hbaseHandler =
new ThriftHBaseServiceHandler(UTIL.getConfiguration(),
UserProvider.instantiate(UTIL.getConfiguration()));
new ThriftHBaseServiceHandler(UTIL.getConfiguration(), UserProvider.instantiate(UTIL.getConfiguration()));
Hbase.Iface handler = HbaseHandlerMetricsProxy.newInstance(hbaseHandler, metrics, conf);
ByteBuffer tTableName = asByteBuffer(tableName.getNameAsString());
@ -813,6 +813,9 @@ public class TestThriftServer {
for (ErrorThrowingGetObserver.ErrorType type : ErrorThrowingGetObserver.ErrorType.values()) {
testExceptionType(handler, metrics, tTableName, rowkey, type);
}
} finally {
UTIL.deleteTable(tableName);
}
}
private void testExceptionType(Hbase.Iface handler, ThriftMetrics metrics,