You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "driftx (via GitHub)" <gi...@apache.org> on 2023/03/13 10:55:34 UTC

[GitHub] [cassandra-dtest] driftx commented on a diff in pull request #207: aligned tests with CASSANDRA-18043

driftx commented on code in PR #207:
URL: https://github.com/apache/cassandra-dtest/pull/207#discussion_r1133755103


##########
compaction_test.py:
##########
@@ -293,45 +250,23 @@ def test_compaction_throughput(self):
         assert float(threshold) + 0.5 >= avgthroughput_mb
 
     @pytest.mark.parametrize("strategy", strategies)
+    @since('2.0', max_version='4.1')
     def test_compaction_strategy_switching(self, strategy):
         """
         Ensure that switching strategies does not result in problems.
         Insert data, switch strategies, then check against data loss.
         """
-        strategies = ['LeveledCompactionStrategy', 'SizeTieredCompactionStrategy', 'DateTieredCompactionStrategy']
-
-        if strategy in strategies:
-            strategies.remove(strategy)
-            cluster = self.cluster
-            cluster.populate(1).start()
-            [node1] = cluster.nodelist()
-
-            for strat in strategies:
-                session = self.patient_cql_connection(node1)
-                create_ks(session, 'ks', 1)
-
-                session.execute("create table ks.cf (key int PRIMARY KEY, val int) with gc_grace_seconds = 0 and compaction= {'class':'" + strategy + "'};")
-
-                for x in range(0, 100):
-                    session.execute('insert into ks.cf (key, val) values (' + str(x) + ',1)')
-
-                node1.flush()
-
-                for x in range(0, 10):
-                    session.execute('delete from cf where key = ' + str(x))
+        compaction_strategy_switching(self, strategy, ['LeveledCompactionStrategy', 'SizeTieredCompactionStrategy', 'DateTieredCompactionStrategy'])
 
-                session.execute("alter table ks.cf with compaction = {'class':'" + strat + "'};")
-
-                for x in range(11, 100):
-                    assert_one(session, "select * from ks.cf where key =" + str(x), [x, 1])
-
-                for x in range(0, 10):
-                    assert_none(session, 'select * from cf where key = ' + str(x))
-
-                node1.flush()
-                cluster.clear()
-                time.sleep(5)
-                cluster.start()
+    @pytest.mark.parametrize("strategy", strategies_without_dtcs)
+    @since('5.0')

Review Comment:
   What prevents this from running against earlier versions?



-- 
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-unsubscribe@cassandra.apache.org

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


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