Skip to content

Commit befebc4

Browse files
authored
STAR-1364: fix RecoveryManagerTruncateTest::testTruncate (#700)
RecoveryManagerTruncateTest::testTruncate incorrectly expected commit log replay to replay some mutations. The condition has been changed to expect no mutations being replayed for the keyspace in which the truncated table resides
1 parent 5fe9c50 commit befebc4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/unit/org/apache/cassandra/db/RecoveryManagerTruncateTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.Arrays;
2323
import java.util.Collection;
2424
import java.util.Collections;
25+
import java.util.List;
2526
import java.util.Map;
2627

2728
import org.junit.Before;
@@ -37,6 +38,7 @@
3738
import org.apache.cassandra.config.ParameterizedClass;
3839
import org.apache.cassandra.db.commitlog.CommitLog;
3940
import org.apache.cassandra.db.commitlog.CommitLogReplayer;
41+
import org.apache.cassandra.db.partitions.FilteredPartition;
4042
import org.apache.cassandra.db.partitions.PartitionUpdate;
4143
import org.apache.cassandra.exceptions.ConfigurationException;
4244
import org.apache.cassandra.io.compress.DeflateCompressor;
@@ -48,7 +50,7 @@
4850
import org.apache.cassandra.security.EncryptionContextGenerator;
4951

5052
import static org.junit.Assert.assertEquals;
51-
import static org.junit.Assert.assertFalse;
53+
import static org.junit.Assert.assertNull;
5254
import static org.junit.Assert.assertTrue;
5355

5456
/**
@@ -112,7 +114,8 @@ public void testTruncate() throws IOException
112114
// and now truncate it
113115
cfs.truncateBlocking();
114116
Map<Keyspace, Integer> replayed = CommitLog.instance.resetUnsafe(false);
115-
assertFalse("Expected mutations to be replayed, but got " + replayed, replayed.isEmpty());
117+
assertNull("Expected no mutations to be replayed for " + keyspace + " keyspace, but got " + replayed,
118+
replayed.get(keyspace));
116119

117120
// and validate truncation.
118121
Util.assertEmptyUnfiltered(Util.cmd(cfs).build());

0 commit comments

Comments
 (0)