Skip to content

test: make org.jbpm.kie.services.test.ProcessServiceWithEntitiesTest deterministic#2495

Open
Jack-LuoHongyi wants to merge 1 commit into
kiegroup:mainfrom
Jack-LuoHongyi:test/deterministic-processservicewithentities
Open

test: make org.jbpm.kie.services.test.ProcessServiceWithEntitiesTest deterministic#2495
Jack-LuoHongyi wants to merge 1 commit into
kiegroup:mainfrom
Jack-LuoHongyi:test/deterministic-processservicewithentities

Conversation

@Jack-LuoHongyi

Copy link
Copy Markdown

Summary

  • Type: deterministic setup (iteration-order / schema-ordered XML)
  • Scope: test-only; no production changes
  • Module: jbpm-services/jbpm-kie-services
  • Test: org.jbpm.kie.services.test.ProcessServiceWithEntitiesTest#testStartProcessAndGetVariables

Root Cause
NonDex randomizes iteration order of unordered collections. DeploymentDescriptorImpl#toXml() depends on the iteration order of internal HashMap/HashSet, producing deployment descriptor XML with non-deterministic element ordering. Under some seeds, the generated XML violates deployment-descriptor.xsd sequence constraints, causing the test setup to fail intermittently.

Fix
Avoid DeploymentDescriptorImpl#toXml() in the test setup. Build the deployment descriptor XML directly in a fixed order that matches the schema, while preserving the same remotable classes and marshalling strategy. This keeps the kjar semantically identical but makes setup deterministic.

Validation

  1. Local unit suite (QueryServiceImplTest) remains stable
  2. NonDex randomized execution (100 runs) passes with zero failures

Risk
Low. Changes are limited to test setup and only enforce deterministic XML ordering without relaxing assertions or affecting production code.

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.

1 participant