spring-data-gemfire icon indicating copy to clipboard operation
spring-data-gemfire copied to clipboard

Fix flaky tests in CollectionUtilsUnitTests

Open CharlesZKQ opened this issue 4 years ago • 0 comments

In org.springframework.data.gemfire.util.CollectionUtilsUnitTests, the tests iterableOfEnumeration() , iterableOfIterator() are all flaky due to the non-deterministic property of HashSet (please refer document). It stores value in non-determined order, so it is possible to report exception when invoking containsExactly(). I fixed by changing the HashSet to LinkedHashSet, which guarantees the order of value added into the set and eliminates the flakiness of these two tests.

CharlesZKQ avatar Nov 22 '21 00:11 CharlesZKQ