From 0433774657a2efdb4aa8b87c09cdbbdd0d08bd0c Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Fri, 21 Jan 2011 15:55:20 +0000 Subject: QPID-3013: create an initial connection to force thread pool startup before the test proceeds, as these may be processor-count dependant and throw the final result off git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1061863 13f79535-47bb-0310-9956-ffa450edef68 --- .../qpid/test/unit/client/connection/ConnectionCloseTest.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'qpid/java') diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionCloseTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionCloseTest.java index 760aa1076c..8f9eaf5815 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionCloseTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionCloseTest.java @@ -45,6 +45,10 @@ public class ConnectionCloseTest extends QpidBrokerTestCase public void testSendReceiveClose() throws Exception { + //Create an initial connection to ensure any necessary thread pools + //are initialised before the test really begins. + Connection intialConnection = getConnection(); + Map before = Thread.getAllStackTraces(); for (int i = 0; i < 50; i++) @@ -72,6 +76,8 @@ public class ConnectionCloseTest extends QpidBrokerTestCase assertEquals(m.getText(), "test"); receiver.close(); } + + intialConnection.close(); // The finalizer is notifying connector thread waiting on a selector key. // This should leave the finalizer enough time to notify those threads -- cgit v1.2.1