Repository: cassandra Updated Branches: refs/heads/cassandra-2.2 81b6c9e99 -> fc7a69b65 refs/heads/cassandra-3.0 b8fb29a6b -> cce9ab236 refs/heads/cassandra-3.11 7bb88deb4 -> b1748198e refs/heads/trunk 84fb7fa6f -> 800f0b394
Fix flaky BlacklistingCompactionsTest Patch by marcuse; reviewed by Jay Zhuang for CASSANDRA-14238 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/fc7a69b6 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/fc7a69b6 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/fc7a69b6 Branch: refs/heads/cassandra-2.2 Commit: fc7a69b65399597a2bf9c6025f035f8fe26724c7 Parents: 81b6c9e Author: Marcus Eriksson <marc...@apache.org> Authored: Thu May 31 16:27:46 2018 +0200 Committer: Marcus Eriksson <marc...@apache.org> Committed: Thu Jun 7 08:35:42 2018 -0700 ---------------------------------------------------------------------- .../cassandra/db/compaction/BlacklistingCompactionsTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/fc7a69b6/test/unit/org/apache/cassandra/db/compaction/BlacklistingCompactionsTest.java ---------------------------------------------------------------------- diff --git a/test/unit/org/apache/cassandra/db/compaction/BlacklistingCompactionsTest.java b/test/unit/org/apache/cassandra/db/compaction/BlacklistingCompactionsTest.java index 2b6a62a..c482116 100644 --- a/test/unit/org/apache/cassandra/db/compaction/BlacklistingCompactionsTest.java +++ b/test/unit/org/apache/cassandra/db/compaction/BlacklistingCompactionsTest.java @@ -48,6 +48,8 @@ public class BlacklistingCompactionsTest { private static final String KEYSPACE1 = "BlacklistingCompactionsTest"; private static final String CF_STANDARD1 = "Standard1"; + // seed hardcoded to one we know works: + private static final Random random = new Random(1); @After public void leakDetect() throws InterruptedException @@ -142,7 +144,7 @@ public class BlacklistingCompactionsTest raf = new RandomAccessFile(sstable.getFilename(), "rw"); assertNotNull(raf); assertTrue(raf.length() > 20); - raf.seek(new Random().nextInt((int)(raf.length() - 20))); + raf.seek(random.nextInt((int)(raf.length() - 20))); // We want to write something large enough that the corruption cannot get undetected // (even without compression) byte[] corruption = new byte[20]; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org