From c971aafb1c478a7c2b40b3e2e42143f6e2657253 Mon Sep 17 00:00:00 2001 From: Caleb Rackliffe Date: Tue, 16 Jun 2020 18:29:26 -0500 Subject: [PATCH] Fix flaky unit test CorruptedSSTablesCompactionsTest Generate valid long keys for the updates applied to the SSTable dataset used in CorruptedSSTablesCompactionsTest Patch by Caleb Rackliffe; Reviewed by Dinesh Joshi and Marcus Eriksson for CASSANDRA-15879 --- .../db/compaction/CorruptedSSTablesCompactionsTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/unit/org/apache/cassandra/db/compaction/CorruptedSSTablesCompactionsTest.java b/test/unit/org/apache/cassandra/db/compaction/CorruptedSSTablesCompactionsTest.java index 92767373a2..1c4387cc73 100644 --- a/test/unit/org/apache/cassandra/db/compaction/CorruptedSSTablesCompactionsTest.java +++ b/test/unit/org/apache/cassandra/db/compaction/CorruptedSSTablesCompactionsTest.java @@ -71,8 +71,11 @@ public class CorruptedSSTablesCompactionsTest public static void defineSchema() throws ConfigurationException { long seed = System.nanoTime(); + //long seed = 754271160974509L; // CASSANDRA-9530: use this seed to reproduce compaction failures if reading empty rows //long seed = 2080431860597L; // CASSANDRA-12359: use this seed to reproduce undetected corruptions + //long seed = 9823169134884L; // CASSANDRA-15879: use this seed to reproduce duplicate clusterings + logger.info("Seed {}", seed); random = new Random(seed); @@ -148,7 +151,7 @@ public class CorruptedSSTablesCompactionsTest { for (int i = 0; i < ROWS_PER_SSTABLE; i++) { - DecoratedKey key = Util.dk(String.valueOf(i)); + DecoratedKey key = Util.dk(String.valueOf(i), LongType.instance); long timestamp = j * ROWS_PER_SSTABLE + i; new RowUpdateBuilder(cfs.metadata, timestamp, key.getKey()) .clustering(Long.valueOf(i))