Skip to content
Permalink
Browse files
fix flakiness in TestDiskBalance caused by random token generation
patch by Adam Holberg, reviewed by brandonwilliams for CASSANDRA-16089
  • Loading branch information
aholmberg authored and driftx committed Sep 29, 2020
1 parent 5890b5f commit e4e8d94ba540743f0b0ccfdd5b8ce3cefc7a6a68
Showing 1 changed file with 4 additions and 1 deletion.
@@ -234,7 +234,10 @@ def _disk_balance_after_boundary_change_test(self, lcs):

# Add a new node, so disk boundaries will change
logger.debug("Bootstrap node2 and flush")
node2 = new_node(cluster, bootstrap=True)
# Fixed initial token to bisect the ring and make sure the nodes are balanced (otherwise a random token is generated).
balanced_tokens = cluster.balanced_tokens(2)
assert balanced_tokens[0] == node1.initial_token # make sure cluster population still works as assumed
node2 = new_node(cluster, token=balanced_tokens[1], bootstrap=True)
node2.start(wait_for_binary_proto=True, jvm_args=["-Dcassandra.migration_task_wait_in_seconds=10"], set_migration_task=False)
node2.flush()

0 comments on commit e4e8d94

Please sign in to comment.