Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029274Openbravo ERP09. Financial managementpublic2015-03-13 15:072015-09-07 11:55
shuehner 
aferraz 
normalminorhave not tried
closedfixed 
5
 
 
dmiguelez
Core
No
0029274: New TestCosting junit test is very very slow
That TestCosting junit test is testing the CostingBackground process which is using weld.

Current those junit test do not call the process directly as that is not supported in junit tests (platform team has a bug about that).

This is tracked in issue 28625.

However the current code to work around that is causing severe slowdown of the Costing tests.

See TestCosting runtime being 17min alone.

Compare to 4-5 min for all other junit tests combined.
Improve the workaround code to call background processes via process monitor.

It currently does

1.) trigger process execution
2.) wait always 5s
3.) then loop 30 attemtps of (check finished, wait 1s)

Proposal:
Remove static 5s wait as that it causing most of the 17min runtime.
Reduce the 1s check in loop to 0.25s as most junit tests seems to finish much faster

In theory that should not affect stability at all assuming that the tests are stable before.

As the current code seems to asusme already:
It is waiting for its own process execution and no other concurrent one should happen.

If that assumption is not true both unchanged + modified code are not stable.
No tags attached.
depends on design defect 0028625 closed aferraz QA Process requests should be called directly instead of using a request in TestCosting 
related to defect 0030557 closed aferraz QA Error in TestCosting when it is executed at midnight 
diff 29274.diff (3,567) 2015-03-13 15:08
https://issues.openbravo.com/file_download.php?file_id=7895&type=bug
Issue History
2015-03-13 15:07shuehnerNew Issue
2015-03-13 15:07shuehnerAssigned To => Sandrahuguet
2015-03-13 15:07shuehnerModules => Core
2015-03-13 15:07shuehnerTriggers an Emergency Pack => No
2015-03-13 15:08shuehnerFile Added: 29274.diff
2015-03-13 15:08shuehnerNote Added: 0075568
2015-03-13 15:15shuehnerRelationship addedrelated to 0028625
2015-03-30 12:26aferrazAssigned ToSandrahuguet => aferraz
2015-04-14 12:48Triage FinanceAssigned Toaferraz => Triage Finance
2015-07-13 18:06aferrazAssigned ToTriage Finance => aferraz
2015-07-13 18:07aferrazRelationship deletedrelated to 0028625
2015-07-13 18:07aferrazRelationship addeddepends on 0028625
2015-08-12 11:10aferrazRelationship addedrelated to 0030557
2015-09-04 09:28hgbotCheckin
2015-09-04 09:28hgbotNote Added: 0080073
2015-09-04 09:28hgbotStatusnew => resolved
2015-09-04 09:28hgbotResolutionopen => fixed
2015-09-04 09:28hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1fc3c80992d592df81340979f43711e7b04aec69 [^]
2015-09-04 15:46hudsonbotCheckin
2015-09-04 15:46hudsonbotNote Added: 0080131
2015-09-07 11:55dmiguelezReview Assigned To => dmiguelez
2015-09-07 11:55dmiguelezNote Added: 0080181
2015-09-07 11:55dmiguelezStatusresolved => closed

Notes
(0075568)
shuehner   
2015-03-13 15:08   
Attached patch does the proposed changes + adds some debugging code to be able to see locally what the process execution runtime vs. waiting time in the junit test is.
(0080073)
hgbot   
2015-09-04 09:28   
Repository: erp/devel/pi
Changeset: 1fc3c80992d592df81340979f43711e7b04aec69
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Aug 12 20:50:50 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/1fc3c80992d592df81340979f43711e7b04aec69 [^]

Fixes issue 28625 & Fixes issue 29274: Update TestCosting tests

Once dependency injection is supported in junit tests, "Costing Background process" and "Price Correction Background" processes will be directly called in TestCosting tests.
Other requests will also be avoided, calling private methods directly, using Reflection.

---
M src-test/src/org/openbravo/test/AllAntTaskTests.java
M src-test/src/org/openbravo/test/AllWebserviceTests.java
M src-test/src/org/openbravo/test/costing/TestCosting.java
M src/org/openbravo/costing/PriceDifferenceBackground.java
---
(0080131)
hudsonbot   
2015-09-04 15:46   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/2c27fe2e93a9 [^]
Maturity status: Test
(0080181)
dmiguelez   
2015-09-07 11:55   
Code Review + Testing Ok