This is an automated email from the ASF dual-hosted git repository.

brandonwilliams pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git


The following commit(s) were added to refs/heads/master by this push:
     new e4e8d94  fix flakiness in TestDiskBalance caused by random token 
generation
e4e8d94 is described below

commit e4e8d94ba540743f0b0ccfdd5b8ce3cefc7a6a68
Author: Adam Holmberg <adam.holmb...@datastax.com>
AuthorDate: Tue Sep 29 12:55:48 2020 -0500

    fix flakiness in TestDiskBalance caused by random token generation
    
    patch by Adam Holberg, reviewed by brandonwilliams for CASSANDRA-16089
---
 disk_balance_test.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/disk_balance_test.py b/disk_balance_test.py
index 3d02ac1..91ba848 100644
--- a/disk_balance_test.py
+++ b/disk_balance_test.py
@@ -234,7 +234,10 @@ class TestDiskBalance(Tester):
 
         # 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()
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to