diff options
| author | Keith Wall <kwall@apache.org> | 2014-11-05 13:42:22 +0000 |
|---|---|---|
| committer | Keith Wall <kwall@apache.org> | 2014-11-05 13:42:22 +0000 |
| commit | 29f9b438248d638df355dae1344dee7b0f7ffa5c (patch) | |
| tree | 346c3cfb47deceebe6522417454eb6a290be0fd1 /qpid/java | |
| parent | 3c2f41d29f26526565d302d5d1c01584eb0c0ab2 (diff) | |
| download | qpid-python-29f9b438248d638df355dae1344dee7b0f7ffa5c.tar.gz | |
NO-JIRA: [Java Tests] Increase timeout to resolve a spruious timeout on a slow CI box
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1636872 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
| -rw-r--r-- | qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java index 6b53776bb6..0bbbe7bf2f 100644 --- a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java +++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java @@ -105,23 +105,31 @@ public class TaskExecutorTest extends TestCase } } }; - new Thread(runnable).start(); - new Thread(runnable).start(); - assertTrue("Tasks have not been submitted", submitLatch.await(1000, TimeUnit.MILLISECONDS)); - assertTrue("The first task has not been triggered", waitForCallLatch.await(1000, TimeUnit.MILLISECONDS)); + Thread t1 = new Thread(runnable); + t1.start(); + Thread t2 = new Thread(runnable); + t2.start(); + + final long timeout = 2000l; + boolean awaitSubmissions = submitLatch.await(timeout, TimeUnit.MILLISECONDS); + assertTrue(submitLatch.getCount() + " task(s) have not been submitted within expected time", awaitSubmissions); + assertTrue("The first task has not been triggered", waitForCallLatch.await(timeout, TimeUnit.MILLISECONDS)); _executor.stopImmediately(); assertFalse("Unexpected stopped state", _executor.isRunning()); - Exception e = submitExceptions.poll(1000l, TimeUnit.MILLISECONDS); + Exception e = submitExceptions.poll(timeout, TimeUnit.MILLISECONDS); assertNotNull("The task execution was not interrupted or cancelled", e); - Exception e2 = submitExceptions.poll(1000l, TimeUnit.MILLISECONDS); + Exception e2 = submitExceptions.poll(timeout, TimeUnit.MILLISECONDS); assertNotNull("The task execution was not interrupted or cancelled", e2); assertTrue("One of the exceptions should be CancellationException:", e2 instanceof CancellationException || e instanceof CancellationException); assertTrue("One of the exceptions should be InterruptedException:", e2 instanceof InterruptedException || e instanceof InterruptedException); + + t1.join(timeout); + t2.join(timeout); } public void testStop() |
