HBASE-14344 Add timeouts to TestHttpServerLifecycle

This commit is contained in:
Matteo Bertozzi 2015-09-03 10:26:27 -07:00
parent 1717de65a4
commit 8a4aee6082

View File

@ -44,12 +44,14 @@ public class TestHttpServerLifecycle extends HttpServerFunctionalTest {
* *
* @throws Throwable on failure * @throws Throwable on failure
*/ */
@Test public void testCreatedServerIsNotAlive() throws Throwable { @Test(timeout=60000)
public void testCreatedServerIsNotAlive() throws Throwable {
HttpServer server = createTestServer(); HttpServer server = createTestServer();
assertNotLive(server); assertNotLive(server);
} }
@Test public void testStopUnstartedServer() throws Throwable { @Test(timeout=60000)
public void testStopUnstartedServer() throws Throwable {
HttpServer server = createTestServer(); HttpServer server = createTestServer();
stop(server); stop(server);
} }
@ -59,7 +61,7 @@ public class TestHttpServerLifecycle extends HttpServerFunctionalTest {
* *
* @throws Throwable on failure * @throws Throwable on failure
*/ */
@Test @Test(timeout=60000)
public void testStartedServerIsAlive() throws Throwable { public void testStartedServerIsAlive() throws Throwable {
HttpServer server = null; HttpServer server = null;
server = createTestServer(); server = createTestServer();
@ -85,7 +87,8 @@ public class TestHttpServerLifecycle extends HttpServerFunctionalTest {
* *
* @throws Throwable on failure * @throws Throwable on failure
*/ */
@Test public void testStoppedServerIsNotAlive() throws Throwable { @Test(timeout=60000)
public void testStoppedServerIsNotAlive() throws Throwable {
HttpServer server = createAndStartTestServer(); HttpServer server = createAndStartTestServer();
assertAlive(server); assertAlive(server);
stop(server); stop(server);
@ -97,7 +100,8 @@ public class TestHttpServerLifecycle extends HttpServerFunctionalTest {
* *
* @throws Throwable on failure * @throws Throwable on failure
*/ */
@Test public void testStoppingTwiceServerIsAllowed() throws Throwable { @Test(timeout=60000)
public void testStoppingTwiceServerIsAllowed() throws Throwable {
HttpServer server = createAndStartTestServer(); HttpServer server = createAndStartTestServer();
assertAlive(server); assertAlive(server);
stop(server); stop(server);
@ -108,11 +112,11 @@ public class TestHttpServerLifecycle extends HttpServerFunctionalTest {
/** /**
* Test that the server is alive once started * Test that the server is alive once started
* *
* @throws Throwable * @throws Throwable
* on failure * on failure
*/ */
@Test @Test(timeout=60000)
public void testWepAppContextAfterServerStop() throws Throwable { public void testWepAppContextAfterServerStop() throws Throwable {
HttpServer server = null; HttpServer server = null;
String key = "test.attribute.key"; String key = "test.attribute.key";