Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.0.0-alpha-1
-
None
-
None
-
Reviewed
Description
The runThriftServer() in TestThriftHttpServer, we have the following :
private void runThriftServer(int customHeaderSize) throws Exception { //...... startHttpServerThread(args.toArray(new String[args.size()])); // wait up to 10s for the server to start for (int i = 0; i < 100 && (thriftServer.serverRunner == null || thriftServer.serverRunner.httpServer == null); i++) { Thread.sleep(100); } //...... checkHttpMethods(url); //...... }
The port may still not open even if the thriftServer.serverRunner != null and thriftServer.serverRunner.httpServer != null, so the checkHttpMethods will get a connection refused ...
We should wait till the port is really listening....