bereng commented on code in PR #1891:
URL: https://github.com/apache/cassandra/pull/1891#discussion_r1111721783
##########
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:
Maybe the solution would be along the lines as discussed
[here](https://github.com/apache/cassandra/pull/1891#pullrequestreview-1297370063)
which seems to fit nicely with the existing codebase if I am not missing
anything.
--
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]