From 04f59d08d6f08c3d83a56ee9de03918c4f1e15d6 Mon Sep 17 00:00:00 2001 From: Jon Meredith Date: Tue, 2 Oct 2018 18:32:43 -0600 Subject: [PATCH] Initialize BufferPool before LongBufferTest starts. --- .../cassandra/utils/memory/LongBufferPoolTest.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/burn/org/apache/cassandra/utils/memory/LongBufferPoolTest.java b/test/burn/org/apache/cassandra/utils/memory/LongBufferPoolTest.java index 17ac5693e67b..fee4f6f3217a 100644 --- a/test/burn/org/apache/cassandra/utils/memory/LongBufferPoolTest.java +++ b/test/burn/org/apache/cassandra/utils/memory/LongBufferPoolTest.java @@ -27,11 +27,13 @@ import java.util.concurrent.atomic.AtomicBoolean; import com.google.common.util.concurrent.Uninterruptibles; +import org.junit.BeforeClass; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.utils.DynamicList; import static org.junit.Assert.*; @@ -40,6 +42,12 @@ public class LongBufferPoolTest { private static final Logger logger = LoggerFactory.getLogger(LongBufferPoolTest.class); + @BeforeClass + public static void setup() throws Exception + { + DatabaseDescriptor.daemonInitialization(); + } + @Test public void testAllocate() throws InterruptedException, ExecutionException { @@ -409,6 +417,7 @@ public Boolean call() throws Exception public static void main(String[] args) throws InterruptedException, ExecutionException { + LongBufferPoolTest.setup(); // beforeTest will not be run by JUnit from main new LongBufferPoolTest().testAllocate(Runtime.getRuntime().availableProcessors(), TimeUnit.HOURS.toNanos(2L), 16 << 20); } @@ -451,4 +460,4 @@ V poll() } } -} \ No newline at end of file +}