HBASE-6655 thrift.TestThriftServerCmdLine takes too much time: 733.972 sec
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1378559 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c09b2f5f5d
commit
9bd419f52d
|
@ -205,6 +205,10 @@ public class TestThriftServer {
|
|||
assertEquals(handler.getTableNames().size(), 2);
|
||||
}
|
||||
|
||||
public static void checkTableList(Hbase.Iface handler) throws Exception {
|
||||
assertTrue(handler.getTableNames().contains(tableAname));
|
||||
}
|
||||
|
||||
public static void dropTestTables(Hbase.Iface handler) throws Exception {
|
||||
handler.disableTable(tableBname);
|
||||
assertFalse(handler.isTableEnabled(tableBname));
|
||||
|
|
|
@ -87,8 +87,8 @@ public class TestThriftServerCmdLine {
|
|||
continue;
|
||||
}
|
||||
for (boolean specifyCompact : new boolean[] {false, true}) {
|
||||
parameters.add(new Object[]{implType, new Boolean(specifyFramed),
|
||||
new Boolean(specifyBindIP), new Boolean(specifyCompact)});
|
||||
parameters.add(new Object[]{implType, specifyFramed,
|
||||
specifyBindIP, specifyCompact});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -167,7 +167,10 @@ public class TestThriftServerCmdLine {
|
|||
|
||||
thriftServer = new ThriftServer(TEST_UTIL.getConfiguration());
|
||||
startCmdLineThread(args.toArray(new String[0]));
|
||||
Threads.sleepWithoutInterrupt(2000);
|
||||
|
||||
while ( thriftServer.serverRunner == null || thriftServer.serverRunner.tserver == null ){
|
||||
Thread.sleep(1);
|
||||
}
|
||||
|
||||
Class<? extends TServer> expectedClass = implType != null ?
|
||||
implType.serverClass : TBoundedThreadPoolServer.class;
|
||||
|
@ -189,6 +192,8 @@ public class TestThriftServerCmdLine {
|
|||
}
|
||||
}
|
||||
|
||||
private static volatile boolean tableCreated = false;
|
||||
|
||||
private void talkToThriftServer() throws Exception {
|
||||
TSocket sock = new TSocket(InetAddress.getLocalHost().getHostName(),
|
||||
port);
|
||||
|
@ -206,10 +211,12 @@ public class TestThriftServerCmdLine {
|
|||
prot = new TBinaryProtocol(transport);
|
||||
}
|
||||
Hbase.Client client = new Hbase.Client(prot);
|
||||
TestThriftServer.doTestTableCreateDrop(client);
|
||||
TestThriftServer.doTestGetRegionInfo(client);
|
||||
TestThriftServer.doTestGetTableRegions(client);
|
||||
TestThriftServer.doTestTableMutations(client);
|
||||
if (!tableCreated){
|
||||
TestThriftServer.createTestTables(client);
|
||||
tableCreated = true;
|
||||
}
|
||||
TestThriftServer.checkTableList(client);
|
||||
|
||||
} finally {
|
||||
sock.close();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue