Dhanno98 commented on PR #5940:
URL: https://github.com/apache/fineract/pull/5940#issuecomment-4835314879

   > ```
   >   
org.apache.fineract.integrationtests.bulkimport.populator.loan.LoanWorkbookPopulatorTest
   >   
   >     Test testLoanWorkbookPopulate() FAILED
   >   
   >     java.lang.AssertionError: 1 expectation failed.
   >     Expected status code <200> but was <500>.
   >         at 
org.apache.fineract.integrationtests.bulkimport.populator.loan.LoanWorkbookPopulatorTest.testLoanWorkbookPopulate(LoanWorkbookPopulatorTest.java:101)
   >   
   >   
   > ```
   
   I investigated the CI failure further.
   
   Initially, I fixed the issue in `ClientChargeRoundingTest` because 
`LoanWorkbookPopulatorTest` was running immediately after it in the same shard, 
and that resolved the failure locally.
   
   However, on the next CI run, `LoanWorkbookPopulatorTest` was scheduled in a 
different shard and this time it ran after `SharesAccountChargeRoundingTest`. 
The same failure occurred again with the same validation error about the 
generated charge name.
   
   After reproducing this locally by running:
   
   * `SharesAccountChargeRoundingTest` → `LoanWorkbookPopulatorTest`
   * `SavingsAccountChargeRoundingTest` → `LoanWorkbookPopulatorTest`
   * `LoanChargeRoundingTest` → `LoanWorkbookPopulatorTest`
   
   I found that all three reproduced the same problem.
   
   The root cause is that these tests create charge names using 
`UUID.randomUUID()`, which includes hyphens. Those charge names remain in the 
database, and later `LoanWorkbookPopulatorTest` creates workbook named ranges 
from them. Excel named ranges don't allow hyphens, so the workbook generation 
fails.
   
   I updated all of the newly added charge rounding tests to generate UUIDs 
without hyphens (`UUID.randomUUID().toString().replace("-", "")`). After that, 
I reran all of the above combinations locally, and `LoanWorkbookPopulatorTest` 
passed in every case.
   
   Since `LoanWorkbookPopulatorTest` can be scheduled after any of these tests 
depending on shard assignment, fixing all of them was necessary rather than 
only `ClientChargeRoundingTest`.
   


-- 
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]

Reply via email to