You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ja...@apache.org on 2018/06/21 13:38:26 UTC

cassandra-dtest git commit: Check --use-off-heap-memtables option and stop if not supported

Repository: cassandra-dtest
Updated Branches:
  refs/heads/master 51c835202 -> 2313e39ee


Check --use-off-heap-memtables option and stop if not supported

patch by Alex Lourie; reviewed by jasobrown for CASSANDRA-14056


Project: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/commit/2313e39e
Tree: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/tree/2313e39e
Diff: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/diff/2313e39e

Branch: refs/heads/master
Commit: 2313e39ee19ea12f304d3e6dd04c41d4f03798ca
Parents: 51c8352
Author: Alex Lourie <al...@instaclustr.com>
Authored: Tue Feb 6 14:04:03 2018 +1030
Committer: Jason Brown <ja...@gmail.com>
Committed: Thu Jun 21 06:37:27 2018 -0700

----------------------------------------------------------------------
 conftest.py   | 14 ++++++++++++--
 run_dtests.py | 11 ++++++++++-
 2 files changed, 22 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/2313e39e/conftest.py
----------------------------------------------------------------------
diff --git a/conftest.py b/conftest.py
index 3e30942..1078989 100644
--- a/conftest.py
+++ b/conftest.py
@@ -18,7 +18,7 @@ from netifaces import AF_INET
 from psutil import virtual_memory
 
 import netifaces as ni
-from ccmlib.common import validate_install_dir, is_win
+from ccmlib.common import validate_install_dir, is_win, get_version_from_build
 
 from dtest_config import DTestConfig
 from dtest_setup import DTestSetup
@@ -105,7 +105,7 @@ def fixture_dtest_cluster_name():
 Not exactly sure why :\ but, this fixture needs to be scoped to function level and not
 session or class. If you invoke pytest with tests across multiple test classes, when scopped
 at session, the root logger appears to get reset between each test class invocation.
-this means that the first test to run not from the first test class (and all subsequent 
+this means that the first test to run not from the first test class (and all subsequent
 tests), will have the root logger reset and see a level of NOTSET. Scoping it at the
 class level seems to work, and I guess it's not that much extra overhead to setup the
 logger once per test class vs. once per session in the grand scheme of things.
@@ -415,6 +415,16 @@ def pytest_collection_modifyitems(items, config):
             raise Exception("Required dtest arguments were missing! You must provide either --cassandra-dir "
                             "or --cassandra-version. Refer to the documentation or invoke the help with --help.")
 
+    # Either cassandra_version or cassandra_dir is defined, so figure out the version
+    CASSANDRA_VERSION = config.getoption("--cassandra-version") or get_version_from_build(config.getoption("--cassandra-dir"))
+
+    # Check that use_off_heap_memtables is supported in this c* version
+    if config.getoption("--use-off-heap-memtables") and ("3.0" <= CASSANDRA_VERSION < "3.4"):
+        raise Exception("The selected Cassandra version %s doesn't support the provided option "
+                        "--use-off-heap-memtables, see https://issues.apache.org/jira/browse/CASSANDRA-9472 "
+                        "for details" % CASSANDRA_VERSION)
+
+
     selected_items = []
     deselected_items = []
 

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/2313e39e/run_dtests.py
----------------------------------------------------------------------
diff --git a/run_dtests.py b/run_dtests.py
index 198cde2..2d6ca20 100755
--- a/run_dtests.py
+++ b/run_dtests.py
@@ -41,6 +41,7 @@ from _pytest.config import Parser
 import argparse
 
 from conftest import pytest_addoption
+from dtest import get_version_from_build
 
 logger = logging.getLogger(__name__)
 
@@ -94,6 +95,14 @@ class RunDTests():
             logging.root.setLevel(logging.DEBUG)
             logger.setLevel(logging.DEBUG)
 
+        # Either cassandra_version or cassandra_dir is defined, so figure out the version
+        CASSANDRA_VERSION = args.cassandra_version or get_version_from_build(args.cassandra_dir)
+
+        if args.use_off_heap_memtables and ("3.0" <= CASSANDRA_VERSION < "3.4"):
+            raise Exception("The selected Cassandra version %s doesn't support the provided option "
+                            "--use-off-heap-memtables, see https://issues.apache.org/jira/browse/CASSANDRA-9472 "
+                            "for details" % CASSANDRA_VERSION)
+
         # Get dictionaries corresponding to each point in the configuration matrix
         # we want to run, then generate a config object for each of them.
         logger.debug('Generating configurations from the following matrix:\n\t{}'.format(args))
@@ -211,7 +220,7 @@ def collect_test_modules(stdout):
 
                 test_collect_xml_lines.append("  </Module>")
                 is_first_class = True
-                has_closed_class= False
+                has_closed_class = False
                 section_has_instance = False
                 section_has_class = False
                 is_first_module = False


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