Abhitocode commented on PR #3788:
URL: 
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3788#issuecomment-2519305923

   @gitgabrio, After debugging the issue with the failing Business Calendar 
example test `CreditCardProcessIT`, I have identified the following possible 
reasons for the failure:
   
   Logs for old business calendar implementation
   ```
   2024-12-04 23:33:08,418 INFO  
[org.kie.kog.qua.pro.dev.DevModeWorkflowLogger] (executor-thread-1) Triggered 
node 'Start' for process 'BusinessCalendarCreditBill' 
(d037c870-78e7-430c-862a-cbfce2cddc2b)
   2024-12-04 23:33:08,423 INFO  
[org.kie.kog.qua.pro.dev.DevModeWorkflowLogger] (executor-thread-1) Triggered 
node 'Process Credit Bill' for process 'BusinessCalendarCreditBill' 
(d037c870-78e7-430c-862a-cbfce2cddc2b)
   2024-12-04 23:33:08,458 INFO  [org.kie.kog.cal.bil.CreditCardService] 
(executor-thread-1) Paying credit card
   2024-12-04 23:33:08,496 INFO  
[org.kie.kog.qua.pro.dev.DevModeWorkflowLogger] (executor-thread-1) Variable 
'creditCardDetails' changed value from: 'null', to: 
'org.kie.kogito.calendar.bill.CreditCardDetails@4ee86809'
   2024-12-04 23:33:08,517 INFO  
[org.kie.kog.qua.pro.dev.DevModeWorkflowLogger] (executor-thread-1) Triggered 
node 'Verify Payment' for process 'BusinessCalendarCreditBill' 
(d037c870-78e7-430c-862a-cbfce2cddc2b)
   2024-12-04 23:33:08,642 INFO  [org.kie.kog.app.UserTasks] 
(executor-thread-1) Registering user task _C10EDD5D-0C5F-4ADB-9B85-28D3B9C7D2A7 
with task name null
   2024-12-04 23:33:08,868 INFO  
[org.kie.kog.qua.pro.dev.DevModeWorkflowLogger] (executor-thread-1) Workflow 
'BusinessCalendarCreditBill' (d037c870-78e7-430c-862a-cbfce2cddc2b) was 
started, now 'Active'
   2024-12-04 23:33:37,037 INFO  
[org.kie.kog.ser.job.imp.SignalProcessInstanceOnExpiredTimer] 
(executor-thread-1) Job 3a4169ba-4aff-4981-8a8c-751c1c7fc061 started
   2024-12-04 23:33:37,055 INFO  
[org.kie.kog.qua.pro.dev.DevModeWorkflowLogger] (executor-thread-1) Triggered 
node 'Cancel Payment' for process 'BusinessCalendarCreditBill' 
(d037c870-78e7-430c-862a-cbfce2cddc2b)
   2024-12-04 23:33:37,057 INFO  [org.kie.kog.cal.bil.CreditCardService] 
(executor-thread-1) cancelling bill
   2024-12-04 23:33:37,059 INFO  
[org.kie.kog.qua.pro.dev.DevModeWorkflowLogger] (executor-thread-1) Variable 
'creditCardDetails' changed value from: 
'org.kie.kogito.calendar.bill.CreditCardDetails@4ee86809', to: 
'org.kie.kogito.calendar.bill.CreditCardDetails@4ee86809'
   2024-12-04 23:33:37,061 INFO  
[org.kie.kog.qua.pro.dev.DevModeWorkflowLogger] (executor-thread-1) Triggered 
node 'End' for process 'BusinessCalendarCreditBill' 
(d037c870-78e7-430c-862a-cbfce2cddc2b)
   2024-12-04 23:33:37,194 INFO  
[org.kie.kog.qua.pro.dev.DevModeWorkflowLogger] (executor-thread-1) Workflow 
'BusinessCalendarCreditBill' (d037c870-78e7-430c-862a-cbfce2cddc2b) completed
   
   ```
   
   Logs for new Business calendar implementation
   ```
   2024-12-04 23:43:19,392 INFO  
[org.kie.kog.qua.pro.dev.DevModeWorkflowLogger] (executor-thread-1) Triggered 
node 'Start' for process 'BusinessCalendarCreditBill' 
(cd7cf39a-c2d3-4840-a69b-320667aa4313)
   2024-12-04 23:43:19,394 INFO  
[org.kie.kog.qua.pro.dev.DevModeWorkflowLogger] (executor-thread-1) Triggered 
node 'Process Credit Bill' for process 'BusinessCalendarCreditBill' 
(cd7cf39a-c2d3-4840-a69b-320667aa4313)
   2024-12-04 23:43:19,400 INFO  [org.kie.kog.cal.bil.CreditCardService] 
(executor-thread-1) Paying credit card
   2024-12-04 23:43:19,408 INFO  
[org.kie.kog.qua.pro.dev.DevModeWorkflowLogger] (executor-thread-1) Variable 
'creditCardDetails' changed value from: 'null', to: 
'org.kie.kogito.calendar.bill.CreditCardDetails@406f70e1'
   2024-12-04 23:43:19,409 INFO  
[org.kie.kog.qua.pro.dev.DevModeWorkflowLogger] (executor-thread-1) Triggered 
node 'Verify Payment' for process 'BusinessCalendarCreditBill' 
(cd7cf39a-c2d3-4840-a69b-320667aa4313)
   2024-12-04 23:43:19,418 INFO  
[org.kie.kog.ser.job.imp.SignalProcessInstanceOnExpiredTimer] 
(executor-thread-2) Skipping Job 4d1501de-fe10-4635-907c-cc9491f557be. There is 
no process for pid cd7cf39a-c2d3-4840-a69b-320667aa4313
   2024-12-04 23:43:19,427 INFO  [org.kie.kog.app.UserTasks] 
(executor-thread-1) Registering user task _C10EDD5D-0C5F-4ADB-9B85-28D3B9C7D2A7 
with task name null
   2024-12-04 23:43:19,554 INFO  
[org.kie.kog.qua.pro.dev.DevModeWorkflowLogger] (executor-thread-1) Workflow 
'BusinessCalendarCreditBill' (cd7cf39a-c2d3-4840-a69b-320667aa4313) was 
started, now 'Active'
   
   ```
   
   1. Difference in Thread Execution for Job Processing
   
   Comparing the logs from the old and new Business Calendar implementation 
there is difference in thread execution:
   
   - Old Implementation:
   
   The **SignalProcessInstanceOnExpiredTimer** is executed on 
`executor-thread-1` after registering the user task. Further Cancel Payment 
node is triggered and the test passes.
   
   - New Implementation:
   
   The **SignalProcessInstanceOnExpiredTimer** is executed on 
`executor-thread-2` before registering the user task. This results in the job 
being skipped with the log:
   “Skipping Job, There is no process for pid”. Consequently, the Cancel 
Payment node is not triggered, and the test fails.
   
   This change in thread execution order may be causing the process to miss key 
events. However, I'm not sure why this change in thread behavior is occurring.
   
   2. Another difference is evaluating expression for 
calculateBusinessTimeAsDate("1s").getTime() - getCurrentTime()
   
   - Old Implementation:
   calculateBusinessTimeAsDate("1s").getTime() - getCurrentTime() evaluates to 
a positive value (e.g., 997ms), timer functions as expected and test passes
   
   - New Implementation:
   
   The same expression evaluates to a negative value (e.g., -3504009ms), which 
may becausing the timer to behave incorrectly and skip the job execution.
   
   These could be the reasons for test failure, however I'm not exactly sure 
and couldn't find exact solution. I would need help solving this.
   
   @martinweiler @pefernan, couldn't find anything beyond the above reasons, 
any suggestions/solutions would be helpful.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to