Closed HildoYe closed 2 years ago
Hi @HildoYe, could you perhaps provide more info about the environment where you are seeing test failures occur? Which OS are you using and which version of Java, for example? That would help me understand a bit more about how/when these failures might occur.
On our team, we typically use either Mac or Linux for development work along with Java 8, and we have not seen these "flakey" test results in the past.
Hi @HildoYe, could you perhaps provide more info about the environment where you are seeing test failures occur? Which OS are you using and which version of Java, for example? That would help me understand a bit more about how/when these failures might occur.
On our team, we typically use either Mac or Linux for development work along with Java 8, and we have not seen these "flakey" test results in the past.
The tests I've done are in Linux and Java 8. It can be reproduced with mvn -pl . edu.illinois:nondex-maven-plugin:1.1.2:nondex -Dtest=TESTNAME
List:
DynamicModelSerializationTest#testAddlPropsNull
DynamicModelSerializationTest#testAlternatePropertyNames
DynamicModelSerializationTest#testDynamicModelMethods
DynamicModelSerializationTest#testModelAPFoo
DynamicModelSerializationTest#testModelAPFooNullTypeToken
DynamicModelSerializationTest#testModelAPInteger
DynamicModelSerializationTest#testModelAPObject
DynamicModelSerializationTest#testModelAPProtectedCtor
DynamicModelSerializationTest#testModelAPString
DynamicModelSerializationTest#testNullValues
RequestBuilderTest#testBodyContent1
RequestBuilderTest#testBodyContent3
RequestBuilderTest#testBodyContentList
RequestUtilsTest#testOmitWithNulls
RequestUtilsTest#testPickWithNulls
@HildoYe did you see the unit test failures only when using your edu.illinois:nondex-maven-plugin:1.1.2:nondex
plugin?
The reason I ask is that we haven't seen any actual unit test failures on Mac or Linux.
Also a bit curious about the reason for your involvement here. Are you using an IBM Cloud SDK that depends on the java core library or are you simply experimenting with the java core to exercise your maven plugin?
Edit: I was able to run a couple of the tests with the "nondex" plugin and see the failures. Since these failures seem to occur only when the plugin is used, I think we'll hold off on merging in this PR for now. Thank you for bringing this to our attention though.
closing without merging as we don't plan to merge this one in...
This PR fixes several flaky tests:
equals()
compares twoHashMap<String, T> dynamicProperties
inDynamicModel
. In this PR,LinkedHashMap
is used instead ofHashMap
to resolve the ordering issue. This solution considers 2DynamicModel
s are same if their elements have the same insertion order. However, theequals()
function should be modified to completely resolve the ordering issue.JSONAssert
library is used to ignore the order difference when comparing 2 JSON strings.