In the above test, the addParams method utilizes a non-deterministic HashMap to store parameters. This lack of determinism results in a change in the order of 'project' and 'projects' within the includedRelations array, consequently causing the test to fail.
This flakiness was identified by the nondex tool created by the researchers of UIUC.
PR Overview:
This PR fixes the flaky/non-deterministic behavior of the following test because it assumes the ordering.
io.katharsis.legacy.queryParams.DefaultQueryParamsConverterTest#testIncludeRelationsMultipleSame
Test Overview:
In the above test, the addParams method utilizes a non-deterministic HashMap to store parameters. This lack of determinism results in a change in the order of 'project' and 'projects' within the includedRelations array, consequently causing the test to fail.
This flakiness was identified by the nondex tool created by the researchers of UIUC.
You can reproduce the issue by running the following commands:
Fix:
To fix the issue I decided to store all of the parameters in a LinkedHashSet so it returns the element in which it is stored.
https://github.com/njain2208/katharsis-framework/blob/36c7411dcf9ae6515c539ec7f38976749939614b/katharsis-core/src/test/java/io/katharsis/legacy/queryParams/AbstractQueryParamsTest.java#L49-L60