kgyrtkirk commented on code in PR #17325:
URL: https://github.com/apache/druid/pull/17325#discussion_r1796514318


##########
extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorSpecTest.java:
##########
@@ -310,71 +317,115 @@ public void testSerdeWithInputFormat() throws IOException
     KafkaSupervisorSpec spec2 = mapper.readValue(serialized, 
KafkaSupervisorSpec.class);
 
     String stable = mapper.writeValueAsString(spec2);
+    String sortedStableJson = sortJsonString(stable);

Review Comment:
   note: this seems like an unconditional resort at the Json level for only 
this test; but I wonder if it only affects this
   from the repro steps: `nondex` have detected that the output here is 
unstable.
   
   I don't know the Kafka part; but there might be lists/arrays for which order 
does matter - sorting all parts of a json unconditionally may possible hide 
issues.
   
   I wonder if it was investigated what causes these mismatches. I suspect that 
some underlying class may use some unstable constructs - in most cases these 
used to boil down to a  `HashSet -> LinkedHashSet`  change...
   
   Another possible way to fix this in a wider scope is to make the 
`KafkaSupervisorSpec` comparable and do the validation at that level; so that 
the real classes can decide if 2 maps/sets are equal or not ; and lists / 
arrays will still be validated correctly
   
   what do you think about these approaches?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to