This is an automated email from the ASF dual-hosted git repository. jlewandowski pushed a commit to branch ds-trunk-5.0--2024-07-24 in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git
commit 0a03225d93942985aa3ca2c57e9b2c3c794ec482 Author: Jacek Lewandowski <[email protected]> AuthorDate: Wed Jun 23 09:55:24 2021 +0200 STAR-247: Standalone scrubber should use the same default sstable format as specified for the test Also made a small refactoring of dtest_config.py (cherry picked from commit 1253168f42c7cbe085ec7dd0f78f5ed509955406) (cherry picked from commit 66b7cba8ea8351a0ca85c09f5d5e904f83156ac3) (cherry picked from commit fb9042e3f00934c732c5504babe14a73abc7a456) (cherry picked from commit 1369b315dfadb6273de3e1ac4e2109b1c6426e93) (cherry picked from commit 8c34af17ea36dee25587350537012a48832db67a) (cherry picked from commit 604884fd7372a260250af5fa37eb3201778333da) (cherry picked from commit d5c8692706aec5fe820bb6bc17c66f4cc4c70ed8) --- dtest_config.py | 13 +++++++++++-- scrub_test.py | 3 +++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dtest_config.py b/dtest_config.py index bfae062a..c8117525 100644 --- a/dtest_config.py +++ b/dtest_config.py @@ -47,8 +47,6 @@ class DTestConfig: self.sstable_format = config.getoption("--sstable-format") if self.sstable_format: assert self.sstable_format in ['bti', 'big'], "SSTable format {} is invalid - must be either bti or big".format(self.sstable_format) - default_sstable_format_prop = " -Dcassandra.sstable.format.default=" + self.sstable_format - os.environ.update({"JVM_EXTRA_OPTS": (os.environ.get("JVM_EXTRA_OPTS") or "") + default_sstable_format_prop}) self.use_vnodes = config.getoption("--use-vnodes") self.configuration_yaml = config.getoption("--configuration-yaml") @@ -102,6 +100,17 @@ class DTestConfig: self.latest_config = False if self.configuration_yaml is None else self.configuration_yaml.endswith("cassandra_latest.yaml") + self.apply_to_env(os.environ, "JVM_EXTRA_OPTS") + + def apply_to_env(self, env, key="JVM_OPTS"): + current = env.get(key) or "" + if self.sstable_format: + default_sstable_format_prop = " -Dcassandra.sstable.format.default=" + self.sstable_format + if not current.__contains__("-Dcassandra.sstable.format.default"): + env.update({key: (env.get(key) or "") + default_sstable_format_prop}) + else: + logger.debug("Skipped adding {} because it is already in the env key {}: {}".format(default_sstable_format_prop, key, current)) + def get_version_from_build(self): # There are times when we want to know the C* version we're testing against diff --git a/scrub_test.py b/scrub_test.py index 19aa0956..8633b511 100644 --- a/scrub_test.py +++ b/scrub_test.py @@ -118,6 +118,9 @@ class TestHelper(Tester): """ node1 = self.cluster.nodelist()[0] env = common.make_cassandra_env(node1.get_install_cassandra_root(), node1.get_node_cassandra_root()) + + self.dtest_config.apply_to_env(env, "JVM_OPTS") + scrub_bin = node1.get_tool('sstablescrub') logger.debug(scrub_bin) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
