diff options
author | Robert Gemmell <robbie@apache.org> | 2011-01-21 15:55:20 +0000 |
---|---|---|
committer | Robert Gemmell <robbie@apache.org> | 2011-01-21 15:55:20 +0000 |
commit | fcc5410f2a59fc39fe5c95afe8d6e1c09f65801e (patch) | |
tree | 74221b22f362e4683ae0119f27b68534a2a2620b /java | |
parent | b53cb8a05962ba2b022227664c38e37f216265ed (diff) | |
download | qpid-python-fcc5410f2a59fc39fe5c95afe8d6e1c09f65801e.tar.gz |
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/qpid@1061863 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r-- | java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionCloseTest.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionCloseTest.java b/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionCloseTest.java index 760aa1076c..8f9eaf5815 100644 --- a/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionCloseTest.java +++ b/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<Thread,StackTraceElement[]> 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 |