Skip to content

Commit

Permalink
fix(nemesis): empty return from get_non_system_ks_cf_list() raise Uns…
Browse files Browse the repository at this point in the history
…upporttedNemesis

In some case we don't have CQL based tables in nemesis (i.e. alternator tests),
and we want those to be skipped automaticlly, and not reported as errors.
  • Loading branch information
fruch authored and Bentsi committed Feb 19, 2020
1 parent 48ba3e6 commit daab391
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sdcm/nemesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def _destroy_data_and_restart_scylla(self):
ks_cfs = get_non_system_ks_cf_list(loader_node=random.choice(self.loaders.nodes),
db_node=self.target_node)
if not ks_cfs:
raise NoKeyspaceFound(
raise UnsupportedNemesis(
'Non-system keyspace and table are not found. CorruptThenRepair nemesis can\'t be run')

# Stop scylla service before deleting sstables to avoid partial deletion of files that are under compaction
Expand Down Expand Up @@ -701,7 +701,8 @@ def _modify_table_property(self, name, val, filter_out_table_with_counter=False,

keyspace_table = random.choice(ks_cfs) if ks_cfs else ks_cfs
if not keyspace_table:
raise ValueError('Non-system keyspace and table are not found. ModifyTableProperties nemesis can\'t be run')
raise UnsupportedNemesis(
'Non-system keyspace and table are not found. ModifyTableProperties nemesis can\'t be run')

cmd = "ALTER TABLE {keyspace_table} WITH {name} = {val};".format(
keyspace_table=keyspace_table, name=name, val=val)
Expand Down Expand Up @@ -1066,8 +1067,9 @@ def toggle_table_ics(self):
ks_cfs = get_non_system_ks_cf_list(loader_node=random.choice(self.loaders.nodes),
db_node=self.target_node)
if not ks_cfs:
self.log.error('Non-system keyspace and table are not found. toggle_tables_ics nemesis can\'t run')
return
raise UnsupportedNemesis(
'Non-system keyspace and table are not found. toggle_tables_ics nemesis can\'t run')

keyspace_table = random.choice(ks_cfs)
keyspace, table = keyspace_table.split('.')
cur_compaction_strategy = get_compaction_strategy(node=self.target_node, keyspace=keyspace,
Expand Down Expand Up @@ -1423,6 +1425,8 @@ def _parse_toppartitions_output(output):

def generate_random_parameters_values(): # pylint: disable=invalid-name
ks_cf_list = get_non_system_ks_cf_list(self.loaders.nodes[0], self.cluster.nodes[0])
if not ks_cf_list:
raise UnsupportedNemesis('User-defined Keyspace and ColumnFamily are not found.')
try:
ks, cf = random.choice(ks_cf_list).split('.')
except IndexError as details:
Expand Down

0 comments on commit daab391

Please sign in to comment.