You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ad...@apache.org on 2020/10/19 14:42:58 UTC

[cassandra-dtest] branch master updated: Skip read repair tests ported to in-JMV

This is an automated email from the ASF dual-hosted git repository.

adelapena pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git


The following commit(s) were added to refs/heads/master by this push:
     new cbb35e8  Skip read repair tests ported to in-JMV
cbb35e8 is described below

commit cbb35e8db8e4641ea8f6b8363ac6ed3a93529362
Author: Andrés de la Peña <a....@gmail.com>
AuthorDate: Mon Oct 19 15:42:08 2020 +0100

    Skip read repair tests ported to in-JMV
    
    patch by Andrés de la Peña; reviewed by Caleb Rackliffe and Benjamin Lerer for CASSANDRA-15977
---
 conftest.py         | 41 +++++++++++++++++++++++++++++++++++++++++
 consistency_test.py |  2 ++
 read_repair_test.py |  8 ++++++--
 3 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/conftest.py b/conftest.py
index a17e876..51d2a58 100644
--- a/conftest.py
+++ b/conftest.py
@@ -484,6 +484,47 @@ def fixture_ported_to_in_jvm(request, fixture_dtest_setup):
             if skip_msg:
                 pytest.skip(skip_msg)
 
+def _skip_ported_msg(current_running_version, ported_from_version):
+    if loose_version_compare(current_running_version, ported_from_version) >= 0:
+        return "ported to in-JVM from %s >= %s" % (ported_from_version, current_running_version)
+
+
+@pytest.fixture(autouse=True)
+def fixture_ported_to_in_jvm(request, fixture_dtest_setup):
+    marker = request.node.get_closest_marker('ported_to_in_jvm')
+    if marker and not request.config.getoption("--use-vnodes"):
+
+        if not marker.args:
+            pytest.skip("ported to in-jvm")
+
+        from_str = marker.args[0]
+        ported_from_version = LooseVersion(from_str)
+
+        # For upgrade tests don't run the test if any of the involved versions
+        # are excluded by the annotation
+        if hasattr(request.cls, "UPGRADE_PATH"):
+            upgrade_path = request.cls.UPGRADE_PATH
+            ccm_repo_cache_dir, _ = ccmlib.repository.setup(upgrade_path.starting_meta.version)
+            starting_version = get_version_from_build(ccm_repo_cache_dir)
+            skip_msg = _skip_ported_msg(starting_version, ported_from_version)
+            if skip_msg:
+                pytest.skip(skip_msg)
+            ccm_repo_cache_dir, _ = ccmlib.repository.setup(upgrade_path.upgrade_meta.version)
+            ending_version = get_version_from_build(ccm_repo_cache_dir)
+            skip_msg = _skip_ported_msg(ending_version, ported_from_version)
+            if skip_msg:
+                pytest.skip(skip_msg)
+        else:
+            # For regular tests the value in the current cluster actually means something so we should
+            # use that to check.
+            # Use cassandra_version_from_build as it's guaranteed to be a LooseVersion
+            # whereas cassandra_version may be a string if set in the cli options
+            current_running_version = fixture_dtest_setup.dtest_config.cassandra_version_from_build
+            skip_msg = _skip_ported_msg(current_running_version, ported_from_version)
+            if skip_msg:
+                pytest.skip(skip_msg)
+
+
 @pytest.fixture(autouse=True)
 def fixture_skip_version(request, fixture_dtest_setup):
     marker = request.node.get_closest_marker('skip_version')
diff --git a/consistency_test.py b/consistency_test.py
index e422b81..2c9f868 100644
--- a/consistency_test.py
+++ b/consistency_test.py
@@ -17,6 +17,7 @@ from tools.data import (create_c1c2_table, insert_c1c2, insert_columns,
                         query_c1c2, rows_to_list)
 
 since = pytest.mark.since
+ported_to_in_jvm = pytest.mark.ported_to_in_jvm
 logger = logging.getLogger(__name__)
 
 ExpectedConsistency = namedtuple('ExpectedConsistency', ('num_write_nodes', 'num_read_nodes', 'is_strong'))
@@ -1499,6 +1500,7 @@ class TestConsistency(Tester):
         node3.stop(wait_other_notice=True)
         assert_none(session, "SELECT * FROM t WHERE id = 0 LIMIT 1", cl=ConsistencyLevel.QUORUM)
 
+    @ported_to_in_jvm('4.0')
     def test_readrepair(self):
         cluster = self.cluster
         cluster.set_configuration_options(values={'hinted_handoff_enabled': False})
diff --git a/read_repair_test.py b/read_repair_test.py
index 58c324f..f3cb6c2 100644
--- a/read_repair_test.py
+++ b/read_repair_test.py
@@ -19,6 +19,7 @@ from tools.jmxutils import JolokiaAgent, make_mbean
 from tools.misc import retry_till_success
 
 since = pytest.mark.since
+ported_to_in_jvm = pytest.mark.ported_to_in_jvm
 logger = logging.getLogger(__name__)
 
 def byteman_validate(node, script, verbose=False, opts=None):
@@ -100,6 +101,7 @@ class TestReadRepair(Tester):
         cluster.start()
 
     @since('3.0')
+    @ported_to_in_jvm('4.0')
     def test_alter_rf_and_run_read_repair(self, fixture_set_cluster_settings):
         """
         @jira_ticket CASSANDRA-10655
@@ -272,6 +274,7 @@ class TestReadRepair(Tester):
                 raise NotRepairedException()
 
     @since('2.0')
+    @ported_to_in_jvm('4.0')
     def test_range_slice_query_with_tombstones(self, fixture_set_cluster_settings):
         """
         @jira_ticket CASSANDRA-8989
@@ -326,6 +329,7 @@ class TestReadRepair(Tester):
             assert "Acquiring switchLock read lock" not in activity
 
     @since('3.0')
+    @ported_to_in_jvm('4.0')
     def test_gcable_tombstone_resurrection_on_range_slice_query(self, fixture_set_cluster_settings):
         """
         @jira_ticket CASSANDRA-11427
@@ -792,6 +796,8 @@ def stop_reads(*nodes, kind='all'):
 kcvv = lambda k, c, v1, v2: [k, c, v1, v2]
 
 
+@since('4.0')
+@ported_to_in_jvm('4.0')
 class TestReadRepairGuarantees(Tester):
 
     @pytest.fixture(scope='function', autouse=True)
@@ -809,7 +815,6 @@ class TestReadRepairGuarantees(Tester):
     def get_cql_connection(self, node, **kwargs):
         return self.patient_exclusive_cql_connection(node, retry_policy=None, **kwargs)
 
-    @since('4.0')
     @pytest.mark.parametrize("repair_type,expect_monotonic",
                              (('blocking', True), ('none', False)),
                              ids=('blocking', 'none'))
@@ -850,7 +855,6 @@ class TestReadRepairGuarantees(Tester):
                 assert listify(results) == [kcvv(1, 0, 1, 1)]
 
 
-    @since('4.0')
     @pytest.mark.parametrize("repair_type,expect_atomic",
                              (('blocking', False), ('none', True)),
                              ids=('blocking', 'none'))


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