You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2009/03/09 09:25:14 UTC
svn commit: r751616 -
/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/Camel715ThreadProcessorTest.java
Author: davsclaus
Date: Mon Mar 9 08:25:13 2009
New Revision: 751616
URL: http://svn.apache.org/viewvc?rev=751616&view=rev
Log:
Added fail in case unit test is slow, to catch in case some bad performance degrade was introduced.
Modified:
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/Camel715ThreadProcessorTest.java
Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/Camel715ThreadProcessorTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/Camel715ThreadProcessorTest.java?rev=751616&r1=751615&r2=751616&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/Camel715ThreadProcessorTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/Camel715ThreadProcessorTest.java Mon Mar 9 08:25:13 2009
@@ -48,6 +48,8 @@
}
public void testThreadProcessor() {
+ long start = System.currentTimeMillis();
+
try {
CamelContext context = new DefaultCamelContext();
@@ -82,6 +84,16 @@
latch.await();
+ long delta = System.currentTimeMillis() - start;
+
+ // should be able to run in approx 5 sec on my local laptop.
+ // we had once a performance degrade that caused this test to take 9x longer
+ // so this is a safe guard that this should not happen again.
+ // in case some slow AIX box can not run this in 10 sec or less, then we
+ // should disable this timing as we want it to trigger on local bulds in case
+ // it happens again
+ assertTrue("Should be faster than 10 sec, took: " + delta, delta < 10000);
+
context.stop();
} catch (Exception ex) {
fail("Get the exception " + ex + "here");