Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0045006Openbravo ERPA. Platformpublic2020-09-07 15:412021-09-03 07:21
alostale 
cberner 
immediatemajorhave not tried
closedfixed 
5
 
PR20Q4 
Core
No
0045006: unstable background scheduler jUnit test
MisfirePolicyTest is unstable failing randomly in CI
ie.
https://builds.openbravo.com/job/mod-simple/13424/testReport/junit/org.openbravo.scheduling.trigger/MisfirePolicyTest/checkMisfirePolicy_clustered_/ [^]
No tags attached.
related to defect 0046159 acknowledged Triage Platform Base DalLockingTest.lockedObjectShouldAllowChildrenCreation is unstable 
caused by feature request 0041484 closed cberner make job scheduling clusterizable 
Issue History
2020-09-07 15:41alostaleNew Issue
2020-09-07 15:41alostaleAssigned To => cberner
2020-09-07 15:41alostaleModules => Core
2020-09-07 15:41alostaleTriggers an Emergency Pack => No
2020-09-07 15:43alostaleRelationship addedcaused by 0041484
2020-09-08 11:40hgbotNote Added: 0122786
2020-09-10 07:06hgbotResolutionopen => fixed
2020-09-10 07:06hgbotStatusnew => closed
2020-09-10 07:06hgbotFixed in Version => PR20Q4
2020-09-10 07:06hgbotNote Added: 0122893
2020-09-10 07:06hgbotNote Added: 0122894
2020-09-15 16:55hgbotNote Added: 0123070
2020-09-16 07:07hgbotNote Added: 0123081
2020-09-16 07:07hgbotNote Added: 0123082
2020-10-05 17:53hgbotNote Added: 0123557
2020-10-09 14:58hgbotNote Added: 0123660
2020-10-09 14:58hgbotNote Added: 0123661
2021-02-16 10:01cbernerRelationship addedrelated to 0045901
2021-02-16 10:11hgbotNote Added: 0126123
2021-02-18 14:47hgbotNote Added: 0126163
2021-02-18 14:47hgbotNote Added: 0126164
2021-09-03 07:21alostaleRelationship addedrelated to 0046159

Notes
(0122786)
hgbot   
2020-09-08 11:40   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/149 [^]
(0122893)
hgbot   
2020-09-10 07:06   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 9c038fa5404812da14fc7c887947f8b0c5111780
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2020-09-10T05:05:23+00:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/9c038fa5404812da14fc7c887947f8b0c5111780 [^]

Fixes ISSUE-45006: Stabilize MisfirePolicyTest when clustered

MisfirePolicyTest checkMisfirePolicyWithSecondlySchedule was not waiting
enough for the execution of the expected 2 jobs. MisfireHandler checks every
second for missed jobs to execute. A lower time for the misfireHandler has been set, 500ms
and delay has been set to 3 seconds.
Also because of this, a race condition was happening when using
Dal transaction to access Lock table by quartz, it should not happen as
misfireHandler has plenty time to check and execute jobs now.

---
M src-test/src/org/openbravo/scheduling/trigger/MisfirePolicyTest.java
---
(0122894)
hgbot   
2020-09-10 07:06   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/149 [^]
(0123070)
hgbot   
2020-09-15 16:55   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/165 [^]
(0123081)
hgbot   
2020-09-16 07:07   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/165 [^]
(0123082)
hgbot   
2020-09-16 07:07   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 0748c7b3b120bdae4df4cf6268be731b72c7e5fa
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2020-09-15T16:51:28+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/0748c7b3b120bdae4df4cf6268be731b72c7e5fa [^]

Related to ISSUE-45006: Stabilize checkMisfirePolicy test in MisfirePolicyTest

Previously some modifications have been made to stabilize checkMisfirePolicyWithSecondlySchedule
By allowing more time for the MisfireHandler to detect the misfire, the
correct execution of the tests is enforced. Wait time for both
checkMisfirePolicy and everyNDaysNotExecutedOnMisfire tests is now 1
second, instead of 500 ms.

---
M src-test/src/org/openbravo/scheduling/trigger/MisfirePolicyTest.java
---
(0123557)
hgbot   
2020-10-05 17:53   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/192 [^]
(0123660)
hgbot   
2020-10-09 14:58   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 135c5be70963d2e930090c7d6861e143fd4d3087
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2020-10-09T14:48:05+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/135c5be70963d2e930090c7d6861e143fd4d3087 [^]

Related to ISSUE-45006: Stabilize MisfirePolicyTest tests in clustered mode

Tests in MisfirePolicyTest class were unstable in CI and as such, some
parts have been implemented with this in mind. scheduleJob method will
try to schedule a job and if it fails, it will retry after 1 second,
until it reaches maximum time of 10 seconds.

This will allow to handle some of the race-conditions that were
happening in CI in this issue.

Also, now those tests will test that the trigger has correctly misfired,
that was previously implied, but now it is actually tested using a
TriggerListener. Also waiting some time if the misfire was not
detected on the first 500ms. The maximum wait time is defined in
MAX_WAIT constant.

---
M src-test/src/org/openbravo/scheduling/trigger/MisfirePolicyTest.java
---
(0123661)
hgbot   
2020-10-09 14:58   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/192 [^]
(0126123)
hgbot   
2021-02-16 10:11   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/314 [^]
(0126163)
hgbot   
2021-02-18 14:47   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 16d7adc08764f2fd9da0a9cdbd5bb25d685012f4
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2021-02-16T10:10:37+01:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/16d7adc08764f2fd9da0a9cdbd5bb25d685012f4 [^]

Related to ISSUE-45006: Stabilize MisfirePolicyTest tests in clustered mode

Tests in MisfirePolicyTest class were unstable in CI and as such, some
parts have been implemented with this in mind. scheduleJob method will
try to schedule a job and if it fails, it will retry after 1 second,
until it reaches maximum time of 10 seconds.

This will allow to handle some of the race-conditions that were
happening in CI in this issue.

Also, now those tests will test that the trigger has correctly misfired,
that was previously implied, but now it is actually tested using a
TriggerListener. Also waiting some time if the misfire was not
detected on the first 500ms. The maximum wait time is defined in
MAX_WAIT constant.

---
M src-test/src/org/openbravo/scheduling/trigger/MisfirePolicyTest.java
---
(0126164)
hgbot   
2021-02-18 14:47   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/314 [^]