Add timeout to PooledByteBufAllocatorTest

Motivation:

Some tests in PooledByteBufAllocatorTest are blocking on a CountDownLatch. We should use a timeout on these tests so these will not block forever on a failure.

Modifications:

Add timeout param to @Test annotation

Result:

Have sane timeouts on tests.
This commit is contained in:
Norman Maurer 2016-05-17 18:23:29 +02:00
parent 43e91c2476
commit b83ffcc447

View File

@ -125,7 +125,7 @@ public class PooledByteBufAllocatorTest {
assertTrue(threadCachesCreated.get());
}
@Test
@Test(timeout = 3000)
public void testNumThreadCachesWithNoDirectArenas() throws InterruptedException {
int numHeapArenas = 1;
final PooledByteBufAllocator allocator =
@ -144,7 +144,7 @@ public class PooledByteBufAllocatorTest {
assertEquals(0, allocator.numThreadLocalCaches());
}
@Test
@Test(timeout = 3000)
public void testThreadCacheToArenaMappings() throws InterruptedException {
int numArenas = 2;
final PooledByteBufAllocator allocator =