dcapwell commented on code in PR #4228:
URL: https://github.com/apache/cassandra/pull/4228#discussion_r2192998642


##########
test/unit/org/apache/cassandra/cql3/SimpleQueryTest.java:
##########
@@ -561,6 +564,32 @@ public void testSStableTimestampOrdering() throws Throwable
         assertRows(execute("SELECT * FROM %s WHERE k1=1"), row(1, 1, 2));
     }
 
+    @Test
+    public void testInvalidCompactionOptions()
+    {
+        try
+        {
+            createTable("CREATE TABLE %s.test (k int PRIMARY KEY, v int) WITH 
compaction = {" +
+                    "'class': 'LeveledCompactionStrategy', " +
+                    "'fanout_size': '90', " +
+                    "'sstable_size_in_mb': '1089'}");
+            fail("fanout_sizeed and sstable_size_in_mb are invalid, but did 
not throw ConfigurationException");
+        }
+        catch (ConfigurationException e)
+        {
+            assertTrue(e.getMessage().contains("your maxSSTableSize must be 
absurdly high to compute"));
+        }
+    }
+
+    @Test
+    public void testValidCompactionOptions()
+    {
+        createTable("CREATE TABLE %s.test (k int PRIMARY KEY, v int) WITH 
compaction = {" +
+                "'class': 'LeveledCompactionStrategy', " +
+                "'fanout_size': '10', " +

Review Comment:
   there are existing tests that cover this
   
   ```
   $ grep -r fanout_size test/
   
test//unit/org/apache/cassandra/cql3/validation/miscellaneous/OverflowTest.java:
                    + "AND compaction = { 'class' : 
'LeveledCompactionStrategy', 'sstable_size_in_mb' : 10, 'fanout_size' : 5 } "
   test//unit/org/apache/cassandra/SchemaLoader.java:        
leveledOptions.put("fanout_size", "5");
   test//unit/org/apache/cassandra/schema/createlike/CreateLikeTest.java:       
 alterTable("ALTER TABLE " + sourceKs + "." + sourceTb + " WITH compaction = 
{'class':'LeveledCompactionStrategy', 'sstable_size_in_mb' : 10, 'fanout_size' 
: 16} ");
   test//unit/org/apache/cassandra/schema/createlike/CreateLikeTest.java:       
 String tableCompactionLcs = createTable(sourceKs, "CREATE TABLE %s (a text, b 
int, c int, primary key (a, b)) WITH compaction = {'class' : 
'LeveledCompactionStrategy', 'sstable_size_in_mb' : 1, 'fanout_size' : 5};");
   test//unit/org/apache/cassandra/schema/createlike/CreateLikeTest.java:       
 String tableCopyAndSetLCSCompaction = createTableLike("CREATE TABLE %s LIKE %s 
WITH compaction = {'class' : 'LeveledCompactionStrategy', 'sstable_size_in_mb' 
: 10, 'fanout_size' : 16};",
   test//unit/org/apache/cassandra/schema/createlike/CreateLikeTest.java:       
                                                                                
                      "fanout_size", "16")))
   test//unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java:       
 createTable("CREATE TABLE %s (id text PRIMARY KEY) WITH compaction = 
{'class':'LeveledCompactionStrategy', 'sstable_size_in_mb':1, 
'fanout_size':5};");
   ```
   
   `test//unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java` 
explicitly touches both configs. 
   
   If there is a reason to keep it can we document in the code why this should 
exist compared to existing tests?



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to