From b83ffcc4471ce5cc68b39fc3545853ac5e2a5f1b Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Tue, 17 May 2016 18:23:29 +0200 Subject: [PATCH] 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. --- .../test/java/io/netty/buffer/PooledByteBufAllocatorTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buffer/src/test/java/io/netty/buffer/PooledByteBufAllocatorTest.java b/buffer/src/test/java/io/netty/buffer/PooledByteBufAllocatorTest.java index b3ab27e948..77b99f351c 100644 --- a/buffer/src/test/java/io/netty/buffer/PooledByteBufAllocatorTest.java +++ b/buffer/src/test/java/io/netty/buffer/PooledByteBufAllocatorTest.java @@ -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 =