adelapena commented on code in PR #1891:
URL: https://github.com/apache/cassandra/pull/1891#discussion_r1107030552
##########
test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java:
##########
@@ -313,16 +314,18 @@ public void testCompactionInvalidTombstone() throws
Throwable
{
DatabaseDescriptor.setCorruptedTombstoneStrategy(Config.CorruptedTombstoneStrategy.exception);
prepare();
+
// write a standard tombstone with negative local deletion time (LDTs
are not set by user and should not be negative):
- RowUpdateBuilder rub = new
RowUpdateBuilder(getCurrentColumnFamilyStore().metadata(), -1,
System.currentTimeMillis() * 1000, 22).clustering(33).delete("b");
- rub.build().apply();
- flush();
- compactAndValidate();
- readAndValidate(true);
- readAndValidate(false);
+ Assertions.assertThatThrownBy(() -> {
+ new RowUpdateBuilder(getCurrentColumnFamilyStore().metadata(),
+ -1,
+ System.currentTimeMillis() * 1000,
+ 22).clustering(33).delete("b");
+ }).isInstanceOf(IllegalArgumentException.class)
+ .hasMessageContaining("is outside the range for an unsigned integer
value");
}
- @Test
+ @Test(expected = RuntimeException.class) // msg = "is outside the range
for an unsigned integer value"
Review Comment:
This means that now it fails on flush, so instead of generating a corrupt
sstable we are not generating the sstable at all, right? Would all other writes
for the same sstable be rejected too? Can this happen on a real use case?
By the way, the test could end in the call to `flush`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]