diff options
| author | Robert Gemmell <robbie@apache.org> | 2011-01-27 12:37:51 +0000 |
|---|---|---|
| committer | Robert Gemmell <robbie@apache.org> | 2011-01-27 12:37:51 +0000 |
| commit | 9630ef3ee2c8e22bd2f952a1603531c4b195663e (patch) | |
| tree | 87a9c3a00ba6487fbc66c42303c9816ba9b3e4ab /qpid/java | |
| parent | 13f37429f7870d2a85306a0a34aae4cd9ccb1f55 (diff) | |
| download | qpid-python-9630ef3ee2c8e22bd2f952a1603531c4b195663e.tar.gz | |
QPID-3013: use an equation based delta threshold that takes processor count into consideration
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1064108 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
| -rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionCloseTest.java | 13 |
1 files changed, 5 insertions, 8 deletions
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 8f9eaf5815..6d1b6de238 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,10 +45,6 @@ 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++) @@ -76,8 +72,6 @@ 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 @@ -87,7 +81,7 @@ public class ConnectionCloseTest extends QpidBrokerTestCase } Map<Thread,StackTraceElement[]> after = Thread.getAllStackTraces(); - + Map<Thread,StackTraceElement[]> delta = new HashMap<Thread,StackTraceElement[]>(after); for (Thread t : before.keySet()) { @@ -96,9 +90,12 @@ public class ConnectionCloseTest extends QpidBrokerTestCase dumpStacks(delta); + int deltaThreshold = (isExternalBroker()? 1 : 2) //InVM creates more thread pools in the same VM + * (Runtime.getRuntime().availableProcessors() + 1) + 5; + assertTrue("Spurious thread creation exceeded threshold, " + delta.size() + " threads created.", - delta.size() < 10); + delta.size() < deltaThreshold); } private void dumpStacks(Map<Thread,StackTraceElement[]> map) |
