Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed flaky test-case testBeanToListGeneration() in class BeanToListGenerationTestCase #404

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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