Fixed a bug that HttpServer in unit test does not start correctly. (#2361)

Because the http client in unit test try to connect to the server when
server is not ready yet.
This commit is contained in:
Mingyu Chen
2019-12-03 20:34:16 +08:00
committed by GitHub
parent 086bb82fd2
commit c8cff85c94
2 changed files with 15 additions and 2 deletions

View File

@ -255,7 +255,9 @@ abstract public class DorisHttpTestCase {
httpServer.setup();
httpServer.start();
// must ensure the http server started before any unit test
Thread.sleep(5000);
while (!httpServer.isStarted()) {
Thread.sleep(500);
}
doSetUp();
}