It appears that test data gets rolled back after a test, EXCEPT for
sequence id's. I would expect all data generated during a test to get rolled back. Any comments? Many thanks, Chris |
In a busy system where you might have a dozen other sequenced IDs issued by the time your transaction is either committed or rolled back... what sorts of problems do you think this would introduce? There are two categories I'm thinking of: performance and data consistency. -David On Jan 21, 2010, at 11:30 AM, Chris Snow wrote: > It appears that test data gets rolled back after a test, EXCEPT for sequence id's. > > I would expect all data generated during a test to get rolled back. > > Any comments? > > Many thanks, > > Chris |
In reply to this post by Chris Snow-3
There was a reason I didn't do this, I just can't remember what it was. Thinking about it freshly, the reason was most likely that asynchronous service calls can't be rolled back currently (they're executed by the JobManager with a regular delegator) and rolling back the sequence ids would cause problems unless we can roll back absolutely everything.
Regards Scott HotWax Media http://www.hotwaxmedia.com On 21/01/2010, at 10:30 AM, Chris Snow wrote: > It appears that test data gets rolled back after a test, EXCEPT for sequence id's. > > I would expect all data generated during a test to get rolled back. > > Any comments? > > Many thanks, > > Chris smime.p7s (3K) Download Attachment |
Hi Scott,
It's not a problem with the test framework, it is with my custom demo data. In my demo data, I was creating workEfforts with id's of 10020 and 10030. During testing I was creating more workEfforts. At one stage, the tests were failing because the new workEfforts were getting already used workEffortId's. I need to change my test data to use lower workEffortId's or change the sequence to start at a higher value. Which would be the preferred ofbiz approach? Many thanks, Chris Scott Gray wrote: > There was a reason I didn't do this, I just can't remember what it was. Thinking about it freshly, the reason was most likely that asynchronous service calls can't be rolled back currently (they're executed by the JobManager with a regular delegator) and rolling back the sequence ids would cause problems unless we can roll back absolutely everything. > > Regards > Scott > > HotWax Media > http://www.hotwaxmedia.com > > On 21/01/2010, at 10:30 AM, Chris Snow wrote: > > >> It appears that test data gets rolled back after a test, EXCEPT for sequence id's. >> >> I would expect all data generated during a test to get rolled back. >> >> Any comments? >> >> Many thanks, >> >> Chris >> > > |
Hi Chris,
On Jan 22, 2010, at 1:29 PM, Chris Snow wrote: > Hi Scott, > > It's not a problem with the test framework, it is with my custom demo data. In my demo data, I was creating workEfforts with id's of 10020 and 10030. > > During testing I was creating more workEfforts. At one stage, the tests were failing because the new workEfforts were getting already used workEffortId's. > > I need to change my test data to use lower workEffortId's or change the sequence to start at a higher value. Which would be the preferred ofbiz approach? > In ofbiz we follow the former approach: in demo/test data we use ids < 10000 Kind regards, Jacopo > Many thanks, > > Chris > > Scott Gray wrote: >> There was a reason I didn't do this, I just can't remember what it was. Thinking about it freshly, the reason was most likely that asynchronous service calls can't be rolled back currently (they're executed by the JobManager with a regular delegator) and rolling back the sequence ids would cause problems unless we can roll back absolutely everything. >> >> Regards >> Scott >> >> HotWax Media >> http://www.hotwaxmedia.com >> >> On 21/01/2010, at 10:30 AM, Chris Snow wrote: >> >> >>> It appears that test data gets rolled back after a test, EXCEPT for sequence id's. >>> >>> I would expect all data generated during a test to get rolled back. >>> >>> Any comments? >>> >>> Many thanks, >>> >>> Chris >>> >> >> > |
Jacopo Cappellato wrote:
> Hi Chris, > > On Jan 22, 2010, at 1:29 PM, Chris Snow wrote: > > >> Hi Scott, >> >> It's not a problem with the test framework, it is with my custom demo data. In my demo data, I was creating workEfforts with id's of 10020 and 10030. >> >> During testing I was creating more workEfforts. At one stage, the tests were failing because the new workEfforts were getting already used workEffortId's. >> >> I need to change my test data to use lower workEffortId's or change the sequence to start at a higher value. Which would be the preferred ofbiz approach? >> >> > > In ofbiz we follow the former approach: in demo/test data we use ids < 10000 > > Kind regards, > > Jacopo > > Many thanks Jacopo! |
In reply to this post by Scott Gray-2
I seems that data created in one test case (e.g. a created workEffort)
is still in the db when I run the next test case. Scott Gray wrote: > There was a reason I didn't do this, I just can't remember what it was. Thinking about it freshly, the reason was most likely that asynchronous service calls can't be rolled back currently (they're executed by the JobManager with a regular delegator) and rolling back the sequence ids would cause problems unless we can roll back absolutely everything. > > Regards > Scott > > HotWax Media > http://www.hotwaxmedia.com > > On 21/01/2010, at 10:30 AM, Chris Snow wrote: > > >> It appears that test data gets rolled back after a test, EXCEPT for sequence id's. >> >> I would expect all data generated during a test to get rolled back. >> >> Any comments? >> >> Many thanks, >> >> Chris >> > > |
Could be, like I said async services can't be rolled back at the moment. We're usually just left with a few CommunicationEvent records from order confirmation emails and there's also a TestingType record created by the service engine tests which causes an entity engine test to fail on subsequent runs. I'll fix it eventually but I've been waiting for the execution branch to come through so I don't have to possibly solve the problem twice.
Regards Scott On 22/01/2010, at 8:03 AM, Chris Snow wrote: > I seems that data created in one test case (e.g. a created workEffort) is still in the db when I run the next test case. > > Scott Gray wrote: >> There was a reason I didn't do this, I just can't remember what it was. Thinking about it freshly, the reason was most likely that asynchronous service calls can't be rolled back currently (they're executed by the JobManager with a regular delegator) and rolling back the sequence ids would cause problems unless we can roll back absolutely everything. >> >> Regards >> Scott >> >> HotWax Media >> http://www.hotwaxmedia.com >> >> On 21/01/2010, at 10:30 AM, Chris Snow wrote: >> >> >>> It appears that test data gets rolled back after a test, EXCEPT for sequence id's. >>> >>> I would expect all data generated during a test to get rolled back. >>> >>> Any comments? >>> >>> Many thanks, >>> >>> Chris >>> >> >> > smime.p7s (3K) Download Attachment |
Hi Scott,
It's no problem - I just wanted to make sure I'm not doing something wrong. Many thanks, Chris Scott Gray wrote: > Could be, like I said async services can't be rolled back at the moment. We're usually just left with a few CommunicationEvent records from order confirmation emails and there's also a TestingType record created by the service engine tests which causes an entity engine test to fail on subsequent runs. I'll fix it eventually but I've been waiting for the execution branch to come through so I don't have to possibly solve the problem twice. > > Regards > Scott > > On 22/01/2010, at 8:03 AM, Chris Snow wrote: > > >> I seems that data created in one test case (e.g. a created workEffort) is still in the db when I run the next test case. >> >> Scott Gray wrote: >> >>> There was a reason I didn't do this, I just can't remember what it was. Thinking about it freshly, the reason was most likely that asynchronous service calls can't be rolled back currently (they're executed by the JobManager with a regular delegator) and rolling back the sequence ids would cause problems unless we can roll back absolutely everything. >>> >>> Regards >>> Scott >>> >>> HotWax Media >>> http://www.hotwaxmedia.com >>> >>> On 21/01/2010, at 10:30 AM, Chris Snow wrote: >>> >>> >>> >>>> It appears that test data gets rolled back after a test, EXCEPT for sequence id's. >>>> >>>> I would expect all data generated during a test to get rolled back. >>>> >>>> Any comments? >>>> >>>> Many thanks, >>>> >>>> Chris >>>> >>>> >>> >>> > > |
Free forum by Nabble | Edit this page |