Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
Description
Tests org.apache.hadoop.hive.common.TestStatsSetupConst#testStatColumnEntriesCompat replies on Jackson to serialize the params to string. However, Jackson library uses reflection API getDeclaredFields but it does not guarantee any specific order of returned field so the order of fields in the json string might change, and thus, test can fail or pass without any changes to the code.
An example error message:
org.junit.ComparisonFailure: expected:<{"[BASIC_STATS":"true","COLUMN_STATS":{"Foo":"true"}]}> but was:<{"[COLUMN_STATS":{"Foo":"true"},"BASIC_STATS":"true"]}> at org.apache.hadoop.hive.common.TestStatsSetupConst.testStatColumnEntriesCompat(TestStatsSetupConst.java:76)
Ideally, this test should not reply on the order returned by this API so that it generates a deterministic result.
An potential solution is to use library like https://github.com/skyscreamer/JSONassert to compare string in a order-agnostic way.
Attachments
Attachments
Issue Links
- links to