-
Notifications
You must be signed in to change notification settings - Fork 311
Closed
Labels
status: waiting-for-triageAn issue we've not yet triagedAn issue we've not yet triaged
Description
-
The flakiness in
CriteriaUnitTests#shouldCreateIsInSetis due to the nondeterministic iteration order ofLines 113 to 119 in 880787f
@Test // DATACASS-343 void shouldCreateIsInSet() { CriteriaDefinition criteria = Criteria.where("foo").in(new HashSet<>(Arrays.asList("a", "b", "c"))); assertThat(serializeToCqlSafely(criteria)).isEqualTo("foo IN {'a','b','c'}"); } HashSet.Lines 115 to 118 in 880787f
private static String toString(Set<?> source) { return iterableToDelimitedString(source, "{", "}", (Converter<Object, Object>) SerializationUtils::serializeToCqlSafely); } Lines 130 to 134 in 880787f
private static <T> String iterableToDelimitedString(Iterable<T> source, String prefix, String postfix, Converter<? super T, Object> transformer) { StringBuilder builder = new StringBuilder(prefix); Iterator<T> iterator = source.iterator(); -
We can include all the possible iteration order into consideration to fix the flakiness. Tentative PR: https://github.com/LeoYimingLi/spring-data-cassandra/pull/2/files
-
version of spring data
SHA: 880787f -
JVM version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~18.04-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode) -
The way to reproduce the flaky test failure:
- 0.Environment setup: Maven 3.6.0 and Java 1.8.0_292
- 1.clone the repo:
git clone https://github.com/spring-projects/spring-data-cassandra cd spring-data-cassandra git checkout 880787ff8841b461c3bff6d0755a485171867a59- 2.run with Nondex tool (which explores different behaviors of under-determined APIs and reports test failures)
mvn install -pl spring-data-cassandra -am -DskipTests mvn -pl spring-data-cassandra edu.illinois:nondex-maven-plugin:1.1.2:debug -Dtest=spring-data-cassandra,org.springframework.data.cassandra.core.query.CriteriaUnitTests#shouldCreateIsInSet
Metadata
Metadata
Assignees
Labels
status: waiting-for-triageAn issue we've not yet triagedAn issue we've not yet triaged
