Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037648Openbravo ERPA. Platformpublic2018-01-16 10:322018-02-22 18:19
shuehner 
alostale 
normalminorhave not tried
closedfixed 
5
 
3.0PR18Q2 
caristu
Core
No
0037648: junit testcase ViewTest.test14914 is very slow (ca. 15-20seconds)
That test checks that DalUtil.copy (with children) does exclude references which are views (and not tables).

However it repeats that test for every invoice in the system (typically from sampledata).

That seems to have not extra benefit and should be simplified.
Note: As different at least ci test may have different sampledata maybe some simple logic to find 1 case could be useful instead of hardcoded id.

Alternatively moving to a different attached view of i.e. some other non-sampledata table could be an option (Note: initial bug 14914 which fixed DalUtil.copy was about invoices though)


          final Invoice copied = (Invoice) DalUtil.copy(o);
          assertTrue(copied.getFINPaymentSchedInvVList().isEmpty());
Check runtime of the testcase either in ci or locally:
https://ci.openbravo.com/view/try/job/try-checks-pgsql/lastCompletedBuild/testReport/org.openbravo.test.dal/ViewTest/ [^]
test14914 => 19 sec
No tags attached.
Issue History
2018-01-16 10:32shuehnerNew Issue
2018-01-16 10:32shuehnerAssigned To => platform
2018-01-16 10:32shuehnerModules => Core
2018-01-16 10:32shuehnerTriggers an Emergency Pack => No
2018-02-09 10:17alostaleAssigned Toplatform => alostale
2018-02-09 10:17alostaleStatusnew => scheduled
2018-02-09 10:33alostaleReview Assigned To => caristu
2018-02-09 10:34hgbotCheckin
2018-02-09 10:34hgbotNote Added: 0102296
2018-02-09 10:34hgbotStatusscheduled => resolved
2018-02-09 10:34hgbotResolutionopen => fixed
2018-02-09 10:34hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/65a8e7ba6ceb0e9721f7c3a2cb706d0c586b3ffd [^]
2018-02-09 10:36alostaleNote Added: 0102297
2018-02-12 12:39hgbotCheckin
2018-02-12 12:39hgbotNote Added: 0102330
2018-02-12 12:40caristuNote Added: 0102331
2018-02-12 12:40caristuStatusresolved => closed
2018-02-12 12:40caristuFixed in Version => 3.0PR18Q2
2018-02-22 18:19hudsonbotCheckin
2018-02-22 18:19hudsonbotNote Added: 0102739
2018-02-22 18:19hudsonbotCheckin
2018-02-22 18:19hudsonbotNote Added: 0102746

Notes
(0102296)
hgbot   
2018-02-09 10:34   
Repository: erp/devel/pi
Changeset: 65a8e7ba6ceb0e9721f7c3a2cb706d0c586b3ffd
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Feb 09 10:15:25 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/65a8e7ba6ceb0e9721f7c3a2cb706d0c586b3ffd [^]

fixed bug 37648: slow junit ViewTest test cases

  testViews (renamed to viewsCanBeQueried)
    * Queries all the visible records for all views in system loading those records
      in memory. Now, record is limited to just one and we stop querying views once
      one record is retrieved.

  test14914
    * All invoices in the instance were loaded in memory loading for those all their
      payments and making a copy. Now only one invoice is loaded.

---
M src-test/src/org/openbravo/test/dal/ViewTest.java
---
(0102297)
alostale   
2018-02-09 10:36   
Comparing times before [1] and after [2] fix:

test14914 14sec -> 50ms
testViews (renamed to viewsCanBeQueried) 190ms -> 26ms


[1] https://ci.openbravo.com/view/try/job/try-checks-pgsql/6532/testReport/org.openbravo.test.dal/ViewTest/ [^]
[2] https://ci.openbravo.com/view/try/job/try-checks-pgsql/6533/testReport/org.openbravo.test.dal/ViewTest/ [^]
(0102330)
hgbot   
2018-02-12 12:39   
Repository: erp/devel/pi
Changeset: 83ecad689e9e3a56a2cebece4ad06b5c70a46296
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Mon Feb 12 12:38:32 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/83ecad689e9e3a56a2cebece4ad06b5c70a46296 [^]

related to issue 37648: updated method javadoc

---
M src-test/src/org/openbravo/test/dal/ViewTest.java
---
(0102331)
caristu   
2018-02-12 12:40   
Code reviewed + tested OK.
(0102739)
hudsonbot   
2018-02-22 18:19   
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/980a6ad5bbf5 [^]
Maturity status: Test
(0102746)
hudsonbot   
2018-02-22 18:19   
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/980a6ad5bbf5 [^]
Maturity status: Test