3 Replies Latest reply on Apr 10, 2013 3:46 AM by jasonnh

    CamelBlueprintTestSupport intermittent camelContext loading problem

    jasonnh

      Hi,

       

      I have some camel routes defined in blueprint doing a variety of things covered by unit tests using CamelBlueprintTestSupport.

       

      Normally the tests pass but approximately every 15-20 attempts they fail with the error:

       

      2013-03-12 15:45:27,317 INFO  CamelBlueprintHelper - Deleting work directory target/bundles/1363103126713 
      2013-03-12 15:45:27,319 DEBUG TestSupport - tearDownAfterClass test 
      Tests run: 6, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 36.082 sec <<< FAILURE!
      testMyTest(com.company.MyRouteTest)  Time elapsed: 30.185 sec  <<< ERROR!
      java.lang.RuntimeException: Gave up waiting for service (objectClass=org.apache.camel.CamelContext)
           at org.apache.camel.test.blueprint.CamelBlueprintHelper.getOsgiService(CamelBlueprintHelper.java:203)
           at org.apache.camel.test.blueprint.CamelBlueprintHelper.getOsgiService(CamelBlueprintHelper.java:161)
           at org.apache.camel.test.blueprint.CamelBlueprintTestSupport.createCamelContext(CamelBlueprintTestSupport.java:116)
           at org.apache.camel.test.junit4.CamelTestSupport.doSetUp(CamelTestSupport.java:247)
           at org.apache.camel.test.junit4.CamelTestSupport.setUp(CamelTestSupport.java:217)
           at org.apache.camel.test.blueprint.CamelBlueprintTestSupport.setUp(CamelBlueprintTestSupport.java:50)
      

       

      The only pattern I can find is that it looks like the class is trying to delete the temp bundles folder and then times out due to the 30 second timeout.  Increasing the timeout does not help.  However, as there is no DEBUG log confirming that directory has been deleted then this may be misleading.

       

      Does anybody know of problems with CamelBlueprintTestSupport?

       

      For example, could something have a lock on one of the files in the bundles temp folder which stops it being deleted?

       

      Thanks.

       

      Edited by: jasonnh on Mar 12, 2013 5:03 PM