You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ma...@apache.org on 2018/06/07 15:45:19 UTC
[03/10] cassandra git commit: Fix flaky BlacklistingCompactionsTest
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-3.11
Commit: fc7a69b65399597a2bf9c6025f035f8fe26724c7
Parents: 81b6c9e
Author: Marcus Eriksson <ma...@apache.org>
Authored: Thu May 31 16:27:46 2018 +0200
Committer: Marcus Eriksson <ma...@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-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org