-
Notifications
You must be signed in to change notification settings - Fork 310
Closed
Description
-
The flakiness in
ColumnsUnitTests#shouldCreateFromColumns
Lines 47 to 53 in 880787f
@Test // DATACASS-343 void shouldCreateFromColumns() { Columns columns = Columns.from("asc", "bar"); assertThat(columns.toString()).isEqualTo("asc, bar"); } Columns from(String... columnNames)
whereHashMap
is used and the order of map is not guaranteed.
Lines 69 to 78 in 880787f
public static Columns from(String... columnNames) { Assert.notNull(columnNames, "Column names must not be null"); Map<ColumnName, Selector> columns = new HashMap<>(columnNames.length, 1); Arrays.stream(columnNames) .forEach(columnName -> columns.put(ColumnName.from(columnName), ColumnSelector.from(columnName))); return new Columns(columns); -
We can use
LinkedHashMap
to replaceHashMap
to keep the order deterministic. Tentative PR to fix the flaky test: https://github.com/LeoYimingLi/spring-data-cassandra/pull/1/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:nondex -Dtest=org.springframework.data.cassandra.core.query.ColumnsUnitTests#shouldCreateFromColumns
Metadata
Metadata
Assignees
Labels
type: taskA general taskA general task