Skip to content
Permalink
Browse files
Fixes needed to support the new configuration framework and change of…
… parameters

patch by Ekaterina Dimitrova, reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
  • Loading branch information
ekaterinadimitrova2 committed Feb 6, 2022
1 parent 0448f15 commit 3935906a685640b2f6a2058b38fdf45d917edfc9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
@@ -44,7 +44,8 @@ def test_sstablelevelreset(self):
except ToolError as e:
assert re.search("ColumnFamily not found: keyspace1/standard1", str(e))
# this should return exit code 1
assert e.exit_status == 1, "Expected sstablelevelreset to have a return code of 1 == but instead return code was {}".format(e.exit_status)
assert e.exit_status == 1, "Expected sstablelevelreset to have a return code of 1 == but instead return code was {}".format(
e.exit_status)

# now test by generating keyspace but not flushing sstables
cluster.start()
@@ -60,7 +61,8 @@ def test_sstablelevelreset(self):
# test by writing small amount of data and flushing (all sstables should be level 0)
cluster.start()
session = self.patient_cql_connection(node1)
session.execute("ALTER TABLE keyspace1.standard1 with compaction={'class': 'LeveledCompactionStrategy', 'sstable_size_in_mb':1};")
session.execute(
"ALTER TABLE keyspace1.standard1 with compaction={'class': 'LeveledCompactionStrategy', 'sstable_size_in_mb':1};")
node1.stress(['write', 'n=1K', 'no-warmup', '-schema', 'replication(factor=1)',
'-rate', 'threads=8'])
node1.flush()
@@ -149,7 +151,8 @@ def test_sstableofflinerelevel(self):
cluster.start()
session = self.patient_cql_connection(node1)
logger.debug("Altering compaction strategy to LCS")
session.execute("ALTER TABLE keyspace1.standard1 with compaction={'class': 'LeveledCompactionStrategy', 'sstable_size_in_mb':1, 'enabled':'false'};")
session.execute(
"ALTER TABLE keyspace1.standard1 with compaction={'class': 'LeveledCompactionStrategy', 'sstable_size_in_mb':1, 'enabled':'false'};")

node1.stress(['write', 'n=1K', 'no-warmup',
'-schema', 'replication(factor=1)',
@@ -182,14 +185,16 @@ def test_sstableofflinerelevel(self):

# Let's reset all sstables to L0
logger.debug("Getting initial levels")
initial_levels = list(self.get_levels(node1.run_sstablemetadata(keyspace="keyspace1", column_families=["standard1"])))
initial_levels = list(
self.get_levels(node1.run_sstablemetadata(keyspace="keyspace1", column_families=["standard1"])))
assert [] != initial_levels
logger.debug('initial_levels:')
logger.debug(initial_levels)
logger.debug("Running sstablelevelreset")
node1.run_sstablelevelreset("keyspace1", "standard1")
logger.debug("Getting final levels")
final_levels = list(self.get_levels(node1.run_sstablemetadata(keyspace="keyspace1", column_families=["standard1"])))
final_levels = list(
self.get_levels(node1.run_sstablemetadata(keyspace="keyspace1", column_families=["standard1"])))
assert [] != final_levels
logger.debug('final levels:')
logger.debug(final_levels)
@@ -260,8 +265,8 @@ def test_sstableverify(self):
# Java-normalized paths. To later compare these with Python-normalized paths, we
# map over each line of out and replace Java-normalized paths with Python equivalents.
outlines = [re.sub("(?<=path=').*(?=')",
lambda match: os.path.normcase(match.group(0)),
line) for line in out.splitlines()]
lambda match: os.path.normcase(match.group(0)),
line) for line in out.splitlines()]

# check output is correct for each sstable
sstables = self._get_final_sstables(node1, "keyspace1", "standard1")
@@ -453,10 +458,12 @@ def test_sstabledump(self):

def _check_stderr_error(self, error):
acceptable = ["Max sstable size of",
"Consider adding more capacity",
"JNA link failure",
"Class JavaLaunchHelper is implemented in both",
"Picked up JAVA_TOOL_OPTIONS:"]
"Consider adding more capacity",
"JNA link failure",
"Class JavaLaunchHelper is implemented in both",
"Picked up JAVA_TOOL_OPTIONS:",
# Warnings for backward compatibility should be logged CASSANDRA-15234
"parameters have been deprecated. They have new names and/or value format"]

if len(error) > 0:
for line in error.splitlines():
@@ -9,7 +9,8 @@
#
# In case you want to test a patch with your own CCM branch, further to changing below CCM repo and branch name, you need to add -e flag at the beginning
# Example: -e git+https://github.com/userb/ccm.git@cassandra-17182#egg=ccm
git+https://github.com/riptano/ccm.git@cassandra-test#egg=ccm
# git+https://github.com/riptano/ccm.git@cassandra-test#egg=ccm
-e git+https://github.com/ekaterinadimitrova2/ccm.git@CASSANDRA-15234-3#egg=ccm
decorator
docopt
enum34
@@ -298,7 +298,10 @@ def assert_stderr_clean(err, acceptable_errors=None):
"objc.*Class JavaLaunchHelper.*?Which one is undefined.",
# Stress tool JMX connection failure, see CASSANDRA-12437
"Failed to connect over JMX; not collecting these stats",
"Picked up JAVA_TOOL_OPTIONS:.*"]
"Picked up JAVA_TOOL_OPTIONS:.*",
# Warnings for backward compatibility should be logged CASSANDRA-15234
".*parameters have been deprecated. They have new names and/or value format; "
+ "For more information, please refer to NEWS.txt*"]

regex_str = r"^({}|\s*|\n)*$".format("|".join(acceptable_errors))
err_str = err.strip()

0 comments on commit 3935906

Please sign in to comment.