Skip to content

Conversation

@hermya
Copy link

@hermya hermya commented Nov 4, 2024

This fix is similar to a previous PR : #403
POINT OF FAILURE -> random attribute ordering produced by factory.classMap(Clazz, Clazz) When field(fromClassField, toClassField) is not called for all hierarchical attributes, the one left out will appear in random order.

Example:

{
"a" : 1,
"b" : {
   "c": 2,
   "d": 3
}
}

and when --""--.field("b.c", "0") is called, (converting obj to List<Object>)

the mapped destination List<Object> could be: [2, 1, 3] OR [2, 3, 1]


Possible fix: for all unmapped attrs, use lexographical ordering or throw exception

Fixed using NonDex, plugin added in parent pom.
Suggested command to check flaky tests :

mvn nondex:nondex

For particular test:

mvn -pl ./core edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=ma.glasnost.orika.test.generator.BeanToListGenerationTestCase#testBeanToListGeneration -DnondexRuns=10 -Dmode=ONE

For more information : https://github.com/TestingResearchIllinois/NonDex

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