Skip to content

FINERACT-2421: Fix shortName collisions in integration tests by routing all generation through uniqueRandomStringContainer#5759

Open
oleksii-novikov-onix wants to merge 1 commit intoapache:developfrom
openMF:FINERACT-2421/fix-shortname-collisions
Open

FINERACT-2421: Fix shortName collisions in integration tests by routing all generation through uniqueRandomStringContainer#5759
oleksii-novikov-onix wants to merge 1 commit intoapache:developfrom
openMF:FINERACT-2421/fix-shortname-collisions

Conversation

@oleksii-novikov-onix
Copy link
Copy Markdown
Contributor

@oleksii-novikov-onix oleksii-novikov-onix commented Apr 10, 2026

Description

  • Fix flaky integration tests that intermittently fail with duplicate.short.name error
  • Three places generated loan product shortName bypassing uniqueRandomStringContainer, causing collisions within the same JVM/DB

The error has occurred several times recently in GA:

CallFailedRuntimeException: HTTP failed: ...url=https://localhost:8443/fineract-provider/api/v1/loanproducts...
  errorBody: {"defaultUserMessage":"Loan product with short name `EA12` already exists",
  "userMessageGlobalisationCode":"error.msg.product.loan.duplicate.short.name"}

Failed job example https://github.com/apache/fineract/actions/runs/24211276415/job/70680889530

Root cause:
FeignLoanHelper and FeignTrialBalanceSummaryReportTest used UUID.randomUUID().substring(0,4), and WorkingCapitalLoanDelinquencyActionIntegrationTest used Utils.randomStringGenerator() - all bypassing the in-memory uniqueRandomStringContainer. Later calls to uniqueRandomStringGenerator() could generate the same value, resulting in a DB unique constraint violation.

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per our guidelines
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made.
  • Follow our coding conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • This PR must not be a "code dump". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.

Your assigned reviewer(s) will follow our guidelines for code reviews.

…ng all generation through uniqueRandomStringContainer
@oleksii-novikov-onix oleksii-novikov-onix force-pushed the FINERACT-2421/fix-shortname-collisions branch from 4cf50ac to 4208fba Compare April 10, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants