Fixed the non deterministic test testSerdeWithSpecAndInputFormat #17500
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed a non deterministic test in
org.apache.druid.indexing.kafka.supervisor.KafkaSupervisorSpecTest.testSerdeWithSpecAndInputFormat
Steps to reproduce
To reproduce the problem, first build the module
kafka-indexing-service
:Then, run the regular test:
To identify the flaky test, execute the following nondex command:
Description
The testSerdeWithSpecAndInputFormat was producing non-deterministic output because the JSON object used in the test did not include a parser that enforced a specific order, unlike other tests. Due to the inherent non-deterministic nature of JSON serialization, this resulted in inconsistent outputs. The dimension spec array gave non deterministic order on different runs as follow-
expected:
"dimensionExclusions":["timestamp","value_min","count","value_sum","__time","value","value_max"]
actual:
"dimensionExclusions":["value_min","count","value_sum","value","value_max","timestamp","__time""]
.The fix involves adding a parser to the JSON like the other tests to ensure a consistent order.
This PR has: