Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035117Openbravo ERPA. Platformpublic2017-02-01 08:152017-09-21 16:49
alostale 
alostale 
highminorrandom
closedfixed 
5
 
3.0PR17Q4 
caristu
Core
No
0035117: unstable DataSourceWhereParameter tests
Tests in DataSourceWhereParameter are sometimes unstable.

They randomly fail with an unclear error message.

Ie.:
org.openbravo.test.datasource.DataSourceWhereParameter.datasourceWithNoManualWhereParameter[ActionRegardingSelector datasource]

Record not present
Expected: is <false>
     but: was <true>

junit.framework.AssertionFailedError: Record not present
Expected: is <false>
     but: was <true>
    at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
    at org.openbravo.test.datasource.DataSourceWhereParameter.datasourceWithNoManualWhereParameter(DataSourceWhereParameter.java:212)
So far unknown conditions to make it fail.

Example of failed case:

https://ci.openbravo.com/job/ret-checks-oracle/4380/testReport/junit/org.openbravo.test.datasource/DataSourceWhereParameter/datasourceWithNoManualWhereParameter_ActionRegardingSelector_datasource_/ [^]
- Improve error message to make easier to understand what is expected and why it failed
- Make it stable
No tags attached.
related to feature request 0035166 closed alostale Allow junit testclasses and test-method to be selectively skipped (when running tests against i.e. addon modules) 
Issue History
2017-02-01 08:15alostaleNew Issue
2017-02-01 08:15alostaleAssigned To => platform
2017-02-01 08:15alostaleModules => Core
2017-02-01 08:15alostaleTriggers an Emergency Pack => No
2017-02-06 11:41shuehnerRelationship addedrelated to 0035166
2017-02-10 09:13alostaleStatusnew => acknowledged
2017-05-04 10:02hgbotCheckin
2017-05-04 10:02hgbotNote Added: 0096373
2017-05-29 17:43hudsonbotCheckin
2017-05-29 17:43hudsonbotNote Added: 0096936
2017-07-31 15:30alostaleNote Added: 0098277
2017-07-31 15:31hgbotCheckin
2017-07-31 15:31hgbotNote Added: 0098278
2017-07-31 15:31hgbotStatusacknowledged => resolved
2017-07-31 15:31hgbotResolutionopen => fixed
2017-07-31 15:31hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/88f469f4c2313c940e2f9dd4994fa32546319319 [^]
2017-07-31 15:31hgbotCheckin
2017-07-31 15:31hgbotNote Added: 0098279
2017-08-01 15:51shuehnerAssigned Toplatform => alostale
2017-08-04 09:33alostaleReview Assigned To => caristu
2017-08-04 10:40caristuNote Added: 0098389
2017-08-04 10:40caristuStatusresolved => closed
2017-08-04 10:40caristuFixed in Version => 3.0PR17Q4
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099288

Notes
(0096373)
hgbot   
2017-05-04 10:02   
Repository: erp/devel/pi
Changeset: 8baa2bae6ff2ca6433a7c850317cffe4f15fa44e
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu May 04 10:01:48 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/8baa2bae6ff2ca6433a7c850317cffe4f15fa44e [^]

related to issue 35117: improved some error messages

  so it makes it easier to anlyze logs when tests fail

---
M src-test/src/org/openbravo/test/datasource/DataSourceSecurity.java
M src-test/src/org/openbravo/test/datasource/TestComboDatasource.java
---
(0096936)
hudsonbot   
2017-05-29 17:43   
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/1ee70113bdc4 [^]
Maturity status: Test
(0098277)
alostale   
2017-07-31 15:30   
Most probably it was failing because of how it checked if record was not present in custom query selector response: the record to assert it was not returned has id "369". The check was performed by simply checking if substring was not present. It is possible 369 substring to be present not as record ID but as part of record timestamp (which is randomly genereated based on creation timestamp).
(0098278)
hgbot   
2017-07-31 15:31   
Repository: erp/devel/pi
Changeset: 88f469f4c2313c940e2f9dd4994fa32546319319
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Jul 28 12:10:42 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/88f469f4c2313c940e2f9dd4994fa32546319319 [^]

fixed 35117: unstable DataSourceWhereParameter tests

  * Added more log information in case it fails
  * Be more precise when checking for row id (asserting on "id" property instead
    of on the full response

---
M src-test/src/org/openbravo/test/datasource/DataSourceWhereParameter.java
---
(0098279)
hgbot   
2017-07-31 15:31   
Repository: erp/devel/pi
Changeset: ab7a251734086f0c86fc20748a119f8c3276e024
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Jul 31 08:52:55 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/ab7a251734086f0c86fc20748a119f8c3276e024 [^]

related to bug 35117: fixed assertions with implicit filters

---
M src-test/src/org/openbravo/test/datasource/DataSourceWhereParameter.java
---
(0098389)
caristu   
2017-08-04 10:40   
Code reviewed + tested OK
(0099288)
hudsonbot   
2017-09-21 16:49   
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/9750b78d3e5c [^]
Maturity status: Test