Skip to content

Commit

Permalink
Fix tests where system_distributed/system_traces default RF stopped d…
Browse files Browse the repository at this point in the history
…ecommission
  • Loading branch information
Kurt committed Dec 13, 2016
1 parent ec41ac7 commit dbad2f7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bootstrap_test.py
Expand Up @@ -544,10 +544,16 @@ def decommissioned_wiped_node_can_gossip_to_single_seed_test(self):
cluster.populate(1)
cluster.start(wait_for_binary_proto=True)

node1 = cluster.nodelist()[0]
# Add a new node, bootstrap=True ensures that it is not a seed
node2 = new_node(cluster, bootstrap=True)
node2.start(wait_for_binary_proto=True, wait_other_notice=True)

session = self.patient_cql_connection(node1)
# reduce system_distributed RF to 2 so we don't require forceful decommission
session.execute("ALTER KEYSPACE system_distributed WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor':'1'};")
session.execute("ALTER KEYSPACE system_traces WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor':'1'};")

# Decommision the new node and kill it
debug("Decommissioning & stopping node2")
node2.decommission()
Expand Down
5 changes: 5 additions & 0 deletions pushed_notifications_test.py
Expand Up @@ -240,6 +240,11 @@ def add_and_remove_node_test(self):
waiter.wait_for_notifications(timeout=30, num_notifications=2)
waiter.clear_notifications()

session = self.patient_cql_connection(node1)
# reduce system_distributed RF to 2 so we don't require forceful decommission
session.execute("ALTER KEYSPACE system_distributed WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor':'1'};")
session.execute("ALTER KEYSPACE system_traces WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor':'1'};")

debug("Adding second node...")
node2 = Node('node2', self.cluster, True, ('127.0.0.2', 9160), ('127.0.0.2', 7000), '7200', '0', None, ('127.0.0.2', 9042))
self.cluster.add(node2, False)
Expand Down
6 changes: 6 additions & 0 deletions topology_test.py
Expand Up @@ -44,6 +44,10 @@ def simple_decommission_test(self):
cluster.start(wait_for_binary_proto=True, jvm_args=["-Dcassandra.size_recorder_interval=1"])
node1, node2, node3 = cluster.nodelist()

session = self.patient_cql_connection(node1)
# reduce system_distributed RF to 2 so we don't require forceful decommission
session.execute("ALTER KEYSPACE system_distributed WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor':'2'};")

# write some data
node1.stress(['write', 'n=10K', 'no-warmup', '-rate', 'threads=8'])

Expand Down Expand Up @@ -108,6 +112,8 @@ def resumable_decommission_test(self):
node1, node2, node3 = cluster.nodelist()

session = self.patient_cql_connection(node2)
# reduce system_distributed RF to 2 so we don't require forceful decommission
session.execute("ALTER KEYSPACE system_distributed WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor':'2'};")
create_ks(session, 'ks', 2)
create_cf(session, 'cf', columns={'c1': 'text', 'c2': 'text'})
insert_c1c2(session, n=10000, consistency=ConsistencyLevel.ALL)
Expand Down

0 comments on commit dbad2f7

Please sign in to comment.