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:
parent
43e91c2476
commit
b83ffcc447
|
@ -125,7 +125,7 @@ public class PooledByteBufAllocatorTest {
|
||||||
assertTrue(threadCachesCreated.get());
|
assertTrue(threadCachesCreated.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(timeout = 3000)
|
||||||
public void testNumThreadCachesWithNoDirectArenas() throws InterruptedException {
|
public void testNumThreadCachesWithNoDirectArenas() throws InterruptedException {
|
||||||
int numHeapArenas = 1;
|
int numHeapArenas = 1;
|
||||||
final PooledByteBufAllocator allocator =
|
final PooledByteBufAllocator allocator =
|
||||||
|
@ -144,7 +144,7 @@ public class PooledByteBufAllocatorTest {
|
||||||
assertEquals(0, allocator.numThreadLocalCaches());
|
assertEquals(0, allocator.numThreadLocalCaches());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(timeout = 3000)
|
||||||
public void testThreadCacheToArenaMappings() throws InterruptedException {
|
public void testThreadCacheToArenaMappings() throws InterruptedException {
|
||||||
int numArenas = 2;
|
int numArenas = 2;
|
||||||
final PooledByteBufAllocator allocator =
|
final PooledByteBufAllocator allocator =
|
||||||
|
|
Loading…
Reference in New Issue
Block a user