Repository: cassandra-dtest
Updated Branches:
  refs/heads/master f45a06b2e -> b9d155615


relocate tokens to their proper places after moving


Project: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/commit/3a338c7b
Tree: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/tree/3a338c7b
Diff: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/diff/3a338c7b

Branch: refs/heads/master
Commit: 3a338c7bac3668da4ceb27f97eab42c5ccd31d03
Parents: f45a06b
Author: Marcus Eriksson <marc...@apache.org>
Authored: Fri Jan 12 16:05:36 2018 +0100
Committer: Jason Brown <jasedbr...@gmail.com>
Committed: Thu Jul 26 10:30:23 2018 -0700

----------------------------------------------------------------------
 topology_test.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/3a338c7b/topology_test.py
----------------------------------------------------------------------
diff --git a/topology_test.py b/topology_test.py
index 47426f0..a00c2ca 100644
--- a/topology_test.py
+++ b/topology_test.py
@@ -283,8 +283,13 @@ class TestTopology(Tester):
         move_node(node3, balancing_tokens[2])
 
         time.sleep(1)
-
         cluster.cleanup()
+        for node in cluster.nodelist():
+            # after moving nodes we need to relocate any tokens in the wrong 
places, and after doing that
+            # we might have overlapping tokens on the disks, so run a major 
compaction to get balance even
+            if cluster.version() >= '3.2':
+                node.nodetool("relocatesstables")
+            node.nodetool("compact")
 
         # Check we can get all the keys
         for n in range(0, 30000):
@@ -292,10 +297,11 @@ class TestTopology(Tester):
 
         # Now the load should be basically even
         sizes = [node.data_size() for node in [node1, node2, node3]]
+        debug("sizes = %s" % sizes)
 
-        assert_almost_equal(sizes[0], sizes[1])
-        assert_almost_equal(sizes[0], sizes[2])
-        assert_almost_equal(sizes[1], sizes[2])
+        assert_almost_equal(sizes[0], sizes[1], error=0.05)
+        assert_almost_equal(sizes[0], sizes[2], error=0.05)
+        assert_almost_equal(sizes[1], sizes[2], error=0.05)
 
     @pytest.mark.no_vnodes
     def test_decommission(self):


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

Reply via email to