You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by cheekychops <sm...@hotmail.com> on 2013/03/11 18:49:18 UTC

Intermittent test failures

I have a test class which extends CamelBlueprintTestSupport which has a
number of test methods on it. The tests follow the normal pattern: set mock
expectations/do stuff/make assertions. Sometimes when I run the tests they
all pass, sometimes some of them fail. When they fail I always get the
following output in the log:

[         Blueprint Extender: 3] BlueprintContainerImpl         INFO  Bundle
SchedulingRouteTest is waiting for namespace handlers
[http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0,
http://camel.apache.org/schema/blueprint]
[         Blueprint Extender: 3] BlueprintContainerImpl         INFO  Bundle
SchedulingRouteTest is waiting for namespace handlers
[http://camel.apache.org/schema/blueprint]
Test bundle headers: Bundle-ManifestVersion=2, Bundle-Name=System Bundle,
Bundle-SymbolicName=de.kalpatec.pojosr.framework, Bundle-Vendor=kalpatec,
Bundle-Version=0.2.1
ServiceReference: [org.apache.camel.spi.TypeConverterLoader], bundle:
de.kalpatec.pojosr.framework [0], symbolicName: de.kalpatec.pojosr.framework
ServiceReference: [org.apache.camel.spi.ComponentResolver], bundle:
org.apache.camel.camel-core [6], symbolicName: org.apache.camel.camel-core
ServiceReference: [org.apache.camel.spi.ComponentResolver], bundle:
org.apache.camel.camel-spring [9], symbolicName:
org.apache.camel.camel-spring
ServiceReference: [org.osgi.service.blueprint.container.BlueprintContainer],
bundle: org.apache.aries.blueprint [37], symbolicName:
org.apache.aries.blueprint
ServiceReference: [org.fusesource.hawtdispatch.Dispatcher], bundle:
org.fusesource.hawtdispatch.hawtdispatch [26], symbolicName:
org.fusesource.hawtdispatch.hawtdispatch
ServiceReference: [org.osgi.service.cm.ConfigurationAdmin], bundle:
org.apache.felix.configadmin [48], symbolicName:
org.apache.felix.configadmin
ServiceReference: [org.apache.camel.spi.LanguageResolver], bundle:
org.apache.camel.camel-spring [9], symbolicName:
org.apache.camel.camel-spring
ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle:
org.apache.aries.blueprint [37], symbolicName: org.apache.aries.blueprint
ServiceReference: [org.apache.camel.spi.TypeConverterLoader], bundle:
org.apache.activemq.activemq-camel [7], symbolicName:
org.apache.activemq.activemq-camel
ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle:
org.apache.camel.camel-blueprint [35], symbolicName:
org.apache.camel.camel-blueprint
ServiceReference: [org.apache.camel.spi.ComponentResolver], bundle:
org.apache.activemq.activemq-camel [7], symbolicName:
org.apache.activemq.activemq-camel
ServiceReference: [org.apache.aries.proxy.ProxyManager], bundle:
org.apache.aries.proxy.impl [39], symbolicName: org.apache.aries.proxy.impl
ServiceReference: [org.apache.camel.spi.TypeConverterLoader], bundle:
org.apache.camel.camel-core [6], symbolicName: org.apache.camel.camel-core
ServiceReference: [org.apache.camel.spi.LanguageResolver], bundle:
org.apache.camel.camel-core [6], symbolicName: org.apache.camel.camel-core
ServiceReference: [org.apache.felix.cm.PersistenceManager], bundle:
org.apache.felix.configadmin [48], symbolicName:
org.apache.felix.configadmin
ServiceReference: [org.osgi.service.packageadmin.PackageAdmin], bundle:
de.kalpatec.pojosr.framework [0], symbolicName: de.kalpatec.pojosr.framework
ServiceReference: [org.apache.aries.blueprint.services.ParserService],
bundle: org.apache.aries.blueprint [37], symbolicName:
org.apache.aries.blueprint
ServiceReference: [org.osgi.framework.hooks.bundle.EventHook], bundle:
org.apache.aries.blueprint [37], symbolicName: org.apache.aries.blueprint
ServiceReference: [org.apache.camel.spi.DataFormatResolver], bundle:
org.apache.camel.camel-jaxb [19], symbolicName: org.apache.camel.camel-jaxb
ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle:
org.apache.aries.blueprint [37], symbolicName: org.apache.aries.blueprint
ServiceReference: [org.osgi.service.blueprint.container.BlueprintContainer],
bundle: org.apache.camel.camel-blueprint [35], symbolicName:
org.apache.camel.camel-blueprint
ServiceReference: [org.apache.camel.spi.ComponentResolver], bundle:
org.apache.camel.camel-jms [8], symbolicName: org.apache.camel.camel-jms
ServiceReference: [org.osgi.service.startlevel.StartLevel], bundle:
de.kalpatec.pojosr.framework [0], symbolicName: de.kalpatec.pojosr.framework
ServiceReference: [org.apache.camel.spi.TypeConverterLoader], bundle:
org.apache.camel.camel-jaxb [19], symbolicName: org.apache.camel.camel-jaxb
[                          main] SchedulingRouteTest            INFO 
********************************************************************************
[                          main] SchedulingRouteTest            INFO 
Testing done:
shouldDisableJob(com.monitise.ep.scheduling.impl.SchedulingRouteTest)
[                          main] SchedulingRouteTest            INFO  Took:
30.148 seconds (30148 millis)
[                          main] SchedulingRouteTest            INFO 
********************************************************************************

I've tried running in eclipse, on the command line, with JDK 1.6 and 1.7,
all with similar results. 

Looking at CamelBlueprintHelper I see this comment:

            // Note that the tracker is not closed to keep the reference
            // This is buggy, as the service reference may change i think
            Object svc = tracker.waitForService(timeout);

Is there a workaround?



--
View this message in context: http://camel.465427.n5.nabble.com/Intermittent-test-failures-tp5728946.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Intermittent test failures

Posted by Claus Ibsen <cl...@gmail.com>.
Hi Shency

You should use the Fuse Forums to ask about Fuse products, and get
help with these products.
This is NOT the appropriate mailing list to post these kind of questions.

This mailing list is for the public Apache Camel project, and not
vendor products.

And yeah I say that even as an employeer working for Red Hat, and
working on the Fuse products.




On Sat, Mar 23, 2013 at 9:53 PM, mostwanted
<sh...@monitise.com> wrote:
>
> I am facing the same issue but while deploying my containers to FUSE ESB
>
> I have 2 containers, out of which any one will fail loading the camel-context.
> No error appart from the INFO messages below. This issue is inconsistent (rarely
> both containers load successfully, most time only one will load).
>
> 2013-03-23 20:31:07,679 | INFO  | -3.12.0-thread-1 | BlueprintCamelContext
>       | e.camel.impl.DefaultCamelContext 1399 | 74 - org.apache.camel.camel-core
> - 2.10.0.fuse-71-047 | Apache Camel 2.10.0.fuse-71-047 (CamelContext:
> heartbeatMonitoringContext) is starting
> 2013-03-23 20:31:07,771 | INFO  | -3.12.0-thread-1 | Activator
>       | BundleTypeConverterLoader$Loader  352 | 74 - org.apache.camel.camel-core
> - 2.10.0.fuse-71-047 | Found 2 @Converter classes to load
> 2013-03-23 20:31:07,775 | INFO  | -3.12.0-thread-1 | Activator
>       | BundleTypeConverterLoader$Loader  352 | 74 - org.apache.camel.camel-core
> - 2.10.0.fuse-71-047 | Found 0 @Converter classes to load
>
>
>
> I have the below in my import-packages in both feature's pom.xmls
>
>                                                         org.osgi.service.blueprint;version="[1.0.0,2.0.0)",
>
>
>
> and
>
>
>                 <dependency>
>                         <groupId>org.apache.camel</groupId>
>                         <artifactId>camel-blueprint</artifactId>
>                         <scope>provided</scope>
>                 </dependency>
>
> What am I doing wrong?
>
> Gives a feeling that FUSE ESB is not reliable :(
>
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Intermittent test failures

Posted by mostwanted <sh...@monitise.com>.
I am facing the same issue but while deploying my containers to FUSE ESB

I have 2 containers, out of which any one will fail loading the camel-context.
No error appart from the INFO messages below. This issue is inconsistent (rarely
both containers load successfully, most time only one will load).

2013-03-23 20:31:07,679 | INFO  | -3.12.0-thread-1 | BlueprintCamelContext     
      | e.camel.impl.DefaultCamelContext 1399 | 74 - org.apache.camel.camel-core
- 2.10.0.fuse-71-047 | Apache Camel 2.10.0.fuse-71-047 (CamelContext:
heartbeatMonitoringContext) is starting
2013-03-23 20:31:07,771 | INFO  | -3.12.0-thread-1 | Activator                 
      | BundleTypeConverterLoader$Loader  352 | 74 - org.apache.camel.camel-core
- 2.10.0.fuse-71-047 | Found 2 @Converter classes to load
2013-03-23 20:31:07,775 | INFO  | -3.12.0-thread-1 | Activator                 
      | BundleTypeConverterLoader$Loader  352 | 74 - org.apache.camel.camel-core
- 2.10.0.fuse-71-047 | Found 0 @Converter classes to load



I have the below in my import-packages in both feature's pom.xmls

							org.osgi.service.blueprint;version="[1.0.0,2.0.0)",



and 


		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-blueprint</artifactId>
			<scope>provided</scope>
		</dependency>

What am I doing wrong?

Gives a feeling that FUSE ESB is not reliable :(



Re: Intermittent test failures

Posted by Ryan Moquin <fr...@gmail.com>.
This solved my unit testing issues with 2.11-SNAPSHOT as well....


On Wed, Mar 13, 2013 at 6:23 AM, cheekychops <sm...@hotmail.com>wrote:

> Thanks Claus, that was it!
>
> Since the project uses camel-blueprint and camel-blueprint-test, I made the
> following exclusion and the problem went away:
>
>                 <dependency>
>                         <groupId>org.apache.camel</groupId>
>                         <artifactId>camel-blueprint</artifactId>
>                 </dependency>
>                 <dependency>
>                         <groupId>org.apache.camel</groupId>
>                         <artifactId>camel-test-blueprint</artifactId>
>                         <scope>test</scope>
>                         <exclusions>
>                                 <exclusion>
>
> <artifactId>org.apache.aries.blueprint</artifactId>
>
> <groupId>org.apache.aries.blueprint</groupId>
>                                 </exclusion>
>                         </exclusions>
>                 </dependency>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Intermittent-test-failures-tp5728946p5729079.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Intermittent test failures

Posted by cheekychops <sm...@hotmail.com>.
Thanks Claus, that was it!

Since the project uses camel-blueprint and camel-blueprint-test, I made the
following exclusion and the problem went away:

		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-blueprint</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-test-blueprint</artifactId>
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<artifactId>org.apache.aries.blueprint</artifactId>
					<groupId>org.apache.aries.blueprint</groupId>
				</exclusion>
			</exclusions>
		</dependency>




--
View this message in context: http://camel.465427.n5.nabble.com/Intermittent-test-failures-tp5728946p5729079.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Intermittent test failures

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Mar 12, 2013 at 7:07 PM, cheekychops <sm...@hotmail.com> wrote:
> I've spent a whole day trying to get this to work, including upgrading to the
> latest Camel (2.11-SNAPSHOT) and ActiveMQ (5.8-SNAPSHOT) to no avail.
>
> The exact same tests work perfectly when the routes are configured in a
> Spring definition and tested with the help of CamelSpringTestSupport.
>
> Other posts in this forum seem to suggest that CamelBlueprintTestSupport
> introduces a race condition when loading the context. Despite a fix being
> committed for that, I wouldn't be surprised if this is causing my issue - I
> sometimes see duplicated lines in the log like this:
>

Make sure your classpath do not have 2+ times Aries Blueprint JARs on
the classpath.
As they register their own blueprint extender, that could lead to 2+
extenders running at runtime, and thus you see the duplicates.



> [         Blueprint Extender: 1] ManagementStrategyFactory      INFO  JMX is
> disabled.
> [         Blueprint Extender: 3] ManagementStrategyFactory      INFO  JMX is
> disabled.
> [         Blueprint Extender: 1] BlueprintCamelContext          INFO  Apache
> Camel 2.10.0.fuse-71-047 (CamelContext: schedulingContext) is starting
> [         Blueprint Extender: 3] BlueprintCamelContext          INFO  Apache
> Camel 2.10.0.fuse-71-047 (CamelContext: schedulingContext) is starting
> [         Blueprint Extender: 1] Activator                      INFO  Found
> 2 @Converter classes to load
> [         Blueprint Extender: 1] Activator                      INFO  Found
> 0 @Converter classes to load
> [         Blueprint Extender: 3] Activator                      INFO  Found
> 2 @Converter classes to load
> [         Blueprint Extender: 3] Activator                      INFO  Found
> 0 @Converter classes to load
> [         Blueprint Extender: 3] StdSchedulerFactory            INFO  Using
> default implementation for ThreadExecutor
> [         Blueprint Extender: 1] StdSchedulerFactory            INFO  Using
> default implementation for ThreadExecutor
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Intermittent-test-failures-tp5728946p5729024.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Intermittent test failures

Posted by cheekychops <sm...@hotmail.com>.
I've spent a whole day trying to get this to work, including upgrading to the
latest Camel (2.11-SNAPSHOT) and ActiveMQ (5.8-SNAPSHOT) to no avail.

The exact same tests work perfectly when the routes are configured in a
Spring definition and tested with the help of CamelSpringTestSupport.

Other posts in this forum seem to suggest that CamelBlueprintTestSupport
introduces a race condition when loading the context. Despite a fix being
committed for that, I wouldn't be surprised if this is causing my issue - I
sometimes see duplicated lines in the log like this:

[         Blueprint Extender: 1] ManagementStrategyFactory      INFO  JMX is
disabled.
[         Blueprint Extender: 3] ManagementStrategyFactory      INFO  JMX is
disabled.
[         Blueprint Extender: 1] BlueprintCamelContext          INFO  Apache
Camel 2.10.0.fuse-71-047 (CamelContext: schedulingContext) is starting
[         Blueprint Extender: 3] BlueprintCamelContext          INFO  Apache
Camel 2.10.0.fuse-71-047 (CamelContext: schedulingContext) is starting
[         Blueprint Extender: 1] Activator                      INFO  Found
2 @Converter classes to load
[         Blueprint Extender: 1] Activator                      INFO  Found
0 @Converter classes to load
[         Blueprint Extender: 3] Activator                      INFO  Found
2 @Converter classes to load
[         Blueprint Extender: 3] Activator                      INFO  Found
0 @Converter classes to load
[         Blueprint Extender: 3] StdSchedulerFactory            INFO  Using
default implementation for ThreadExecutor
[         Blueprint Extender: 1] StdSchedulerFactory            INFO  Using
default implementation for ThreadExecutor




--
View this message in context: http://camel.465427.n5.nabble.com/Intermittent-test-failures-tp5728946p5729024.html
Sent from the Camel - Users mailing list archive at Nabble.com.