Login  Register

[jira] Closed: (OFBIZ-3124) concurrency issue in service-eca-global-event-exec service test

Posted by Nicolas Malin (Jira) on Nov 12, 2009; 9:24pm
URL: http://ofbiz.116.s1.nabble.com/jira-Created-OFBIZ-3124-concurrency-issue-in-service-eca-global-event-exec-service-test-tp277863p620580.html


     [ https://issues.apache.org/jira/browse/OFBIZ-3124?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Gray closed OFBIZ-3124.
-----------------------------

       Resolution: Fixed
    Fix Version/s: SVN trunk
                   Release Branch 9.04

Thanks Jeremy fixed in trunk r835548 & r835546 and in v9.04 r835553

I ended up using the common blockingTestSvc as an eca return event which is triggered after the global ecas and gives them enough time to complete before finally allowing the test service to return

> concurrency issue in service-eca-global-event-exec service test
> ---------------------------------------------------------------
>
>                 Key: OFBIZ-3124
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-3124
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 9.04
>            Reporter: Wickersheimer Jeremy
>            Assignee: Scott Gray
>            Priority: Minor
>             Fix For: Release Branch 9.04, SVN trunk
>
>
> There is a problem in the test service-eca-global-event-exec which sometimes fails because the global-* eca are actually running in separate threads than the main test thread.
> Therefore it sometimes happen that service-eca-global-event-exec-assert-data gets executed befaure the needed secas had a chance to finish running.
> Here is for example the log part i get on failure (some debug lines added by me). You can see [testServiceEcaGlobalEventExecOnCommit updated SVC_SECAGC.] happens after the assert failure.
> {code}
>      [java] 2009-10-29 11:33:20,215 (main) [   TestRunContainer.java:220:INFO ] [JUNIT (end)] : service-eca-global-event-exec(org.ofbiz.testtools.ServiceTest) finished. (in 63 ms)
>      [java] 2009-10-29 11:33:20,216 (main) [   TestRunContainer.java:224:INFO ] [JUNIT (start)] : service-eca-global-event-exec-assert-data(org.ofbiz.testtools.EntityXmlAssertTest) starting...
>      [java] 2009-10-29 11:33:20,218 (Thread-99) [   ServiceXaWrapper.java:294:INFO ] [Commit] Invoking [testServiceEcaGlobalEventExecOnCommit] via runSyncIgnore
>      [java] 2009-10-29 11:33:20,222 (Thread-99) [  ServiceDispatcher.java:257:INFO ] [ServiceDispatcher.runSync] : invoking service testServiceEcaGlobalEventExecOnCommit [org.ofbiz.service.test.ServiceEngineTestServices/testServiceEcaGlobalEventExecOnCommit] (java) INPUT = [locale=en_US, userLogin=null]
>      [java] 2009-10-29 11:33:20,222 (Thread-99) [ServiceEngineTestServices.java:354:INFO ] testServiceEcaGlobalEventExecOnCommit starting ...
>      [java] 2009-10-29 11:33:20,225 (Thread-97) [  ServiceDispatcher.java:582:INFO ] Sync service [test-dispatcher-l76D0XsSak/testServiceEcaGlobalEventExecOnRollback] finished in [20] milliseconds, OUTPUT = [responseMessage=success]
>      [java] 2009-10-29 11:33:20,229 (main) [   TestRunContainer.java:216:WARN ]
>      [java] ---- error report --------------------------------------------------------------
>      [java] [JUNIT (failure)] - org.ofbiz.testtools.EntityXmlAssertTest : Field [TestingType.description] did not match; file value [New description for SVC_SECAGC, what it should be after the global-commit test], db value [Original description for SVC_SECAGC; if this is still here the global-commit event didn't run] pk [[GenericEntity:TestingType][testingTypeId,SVC_SECAGC(java.lang.String)]]
>      [java] Exception: junit.framework.AssertionFailedError
>      [java] Message: Field [TestingType.description] did not match; file value [New description for SVC_SECAGC, what it should be after the global-commit test], db value [Original description for SVC_SECAGC; if this is still here the global-commit event didn't run] pk [[GenericEntity:TestingType][testingTypeId,SVC_SECAGC(java.lang.String)]]
>      [java] ---- stack trace ---------------------------------------------------------------
>      [java] junit.framework.AssertionFailedError: Field [TestingType.description] did not match; file value [New description for SVC_SECAGC, what it should be after the global-commit test], db value [Original description for SVC_SECAGC; if this is still here the global-commit event didn't run] pk [[GenericEntity:TestingType][testingTypeId,SVC_SECAGC(java.lang.String)]]
>      [java] org.ofbiz.testtools.EntityXmlAssertTest.run(EntityXmlAssertTest.java:90)
>      [java] junit.framework.TestSuite.runTest(TestSuite.java:208)
>      [java] junit.framework.TestSuite.run(TestSuite.java:203)
>      [java] org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:139)
>      [java] org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:102)
>      [java] org.ofbiz.base.start.Start.startStartLoaders(Start.java:264)
>      [java] org.ofbiz.base.start.Start.startServer(Start.java:313)
>      [java] org.ofbiz.base.start.Start.start(Start.java:317)
>      [java] org.ofbiz.base.start.Start.main(Start.java:400)
>      [java] --------------------------------------------------------------------------------
>      [java]
>      [java] 2009-10-29 11:33:20,230 (Thread-99) [ServiceEngineTestServices.java:359:INFO ] testServiceEcaGlobalEventExecOnCommit updated SVC_SECAGC.
>      [java] 2009-10-29 11:33:20,231 (Thread-99) [  ServiceDispatcher.java:582:INFO ] Sync service [test-dispatcher-l76D0XsSak/testServiceEcaGlobalEventExecOnCommit] finished in [9] milliseconds, OUTPUT = [responseMessage=success]
>      [java] 2009-10-29 11:33:20,236 (main) [   TestRunContainer.java:220:INFO ] [JUNIT (end)] : service-eca-global-event-exec-assert-data(org.ofbiz.testtools.EntityXmlAssertTest) finished. (in 19 ms)
> {code}
> A possible solution is to add a pause before the assert, it could be a simple hack (for now i insert a test-case with a service that just sleep for a while) but it could be useful to have this integrated in /test-suite.xsd and be able to do :
> {code:xml}
>     <test-case case-name="service-eca-global-event-exec-assert-data">
>         <sleep milliseconds="5000" />
>         <entity-xml action="assert" entity-xml-url="component://service/testdef/data/ServiceEcaGlobalEventAssertData.xml"/>
>     </test-case>
> {code}

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.