You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2014/11/05 14:42:23 UTC

svn commit: r1636872 - /qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java

Author: kwall
Date: Wed Nov  5 13:42:22 2014
New Revision: 1636872

URL: http://svn.apache.org/r1636872
Log:
NO-JIRA: [Java Tests] Increase timeout to resolve a spruious timeout on a slow CI box

Modified:
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java?rev=1636872&r1=1636871&r2=1636872&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java Wed Nov  5 13:42:22 2014
@@ -105,23 +105,31 @@ public class TaskExecutorTest extends Te
                 }
             }
         };
-        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()



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org