You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by pa...@apache.org on 2018/01/24 17:27:35 UTC
cassandra-dtest git commit: Fix flaky view builder tests (#14159)
Repository: cassandra-dtest
Updated Branches:
refs/heads/master 0d468af9e -> b4a12292f
Fix flaky view builder tests (#14159)
Project: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/commit/b4a12292
Tree: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/tree/b4a12292
Diff: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/diff/b4a12292
Branch: refs/heads/master
Commit: b4a12292f6e10d0742027da056b61638ff4cfb28
Parents: 0d468af
Author: Paulo Motta <pa...@gmail.com>
Authored: Sun Jan 21 21:22:07 2018 -0200
Committer: Paulo Motta <pa...@apache.org>
Committed: Wed Jan 24 15:26:07 2018 -0200
----------------------------------------------------------------------
materialized_views_test.py | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/b4a12292/materialized_views_test.py
----------------------------------------------------------------------
diff --git a/materialized_views_test.py b/materialized_views_test.py
index f42492a..22c69c8 100644
--- a/materialized_views_test.py
+++ b/materialized_views_test.py
@@ -1037,7 +1037,7 @@ class TestMaterializedViews(Tester):
session.execute("CREATE TABLE t (id int PRIMARY KEY, v int, v2 text, v3 decimal)")
debug("Inserting initial data")
- for i in xrange(10000):
+ for i in xrange(5000):
session.execute("INSERT INTO t (id, v, v2, v3) VALUES ({v}, {v}, 'a', 3.0) IF NOT EXISTS".format(v=i))
debug("Slowing down MV build with byteman")
@@ -1048,6 +1048,9 @@ class TestMaterializedViews(Tester):
session.execute(("CREATE MATERIALIZED VIEW t_by_v AS SELECT * FROM t "
"WHERE v IS NOT NULL AND id IS NOT NULL PRIMARY KEY (v, id)"))
+ debug("Wait and ensure the MV build has started. Waiting up to 2 minutes.")
+ self._wait_for_view_build_start(session, 'ks', 't_by_v', wait_minutes=2)
+
debug("Drop the MV while it is still building")
session.execute("DROP MATERIALIZED VIEW t_by_v")
@@ -1071,7 +1074,7 @@ class TestMaterializedViews(Tester):
debug("Verify that the MV has been successfully created")
self._wait_for_view('ks', 't_by_v')
- assert_one(session, "SELECT COUNT(*) FROM t_by_v", [10000])
+ assert_one(session, "SELECT COUNT(*) FROM t_by_v", [5000])
@since('4.0')
def test_drop_with_stopped_build(self):
@@ -1082,7 +1085,7 @@ class TestMaterializedViews(Tester):
nodes = self.cluster.nodelist()
debug("Inserting initial data")
- for i in xrange(10000):
+ for i in xrange(5000):
session.execute("INSERT INTO t (id, v, v2, v3) VALUES ({v}, {v}, 'a', 3.0) IF NOT EXISTS".format(v=i))
debug("Slowing down MV build with byteman")
@@ -1093,6 +1096,9 @@ class TestMaterializedViews(Tester):
session.execute(("CREATE MATERIALIZED VIEW t_by_v AS SELECT * FROM t "
"WHERE v IS NOT NULL AND id IS NOT NULL PRIMARY KEY (v, id)"))
+ debug("Wait and ensure the MV build has started. Waiting up to 2 minutes.")
+ self._wait_for_view_build_start(session, 'ks', 't_by_v', wait_minutes=2)
+
debug("Stopping all running view build tasks with nodetool")
for node in nodes:
node.watch_log_for('Starting new view build for range', filename='debug.log', timeout=60)
@@ -1127,7 +1133,7 @@ class TestMaterializedViews(Tester):
debug("Verify that the MV has been successfully created")
self._wait_for_view('ks', 't_by_v')
- assert_one(session, "SELECT COUNT(*) FROM t_by_v", [10000])
+ assert_one(session, "SELECT COUNT(*) FROM t_by_v", [5000])
@since('4.0')
def test_resume_stopped_build(self):
@@ -1138,7 +1144,7 @@ class TestMaterializedViews(Tester):
nodes = self.cluster.nodelist()
debug("Inserting initial data")
- for i in xrange(10000):
+ for i in xrange(5000):
session.execute("INSERT INTO t (id, v, v2, v3) VALUES ({v}, {v}, 'a', 3.0) IF NOT EXISTS".format(v=i))
debug("Slowing down MV build with byteman")
@@ -1149,6 +1155,9 @@ class TestMaterializedViews(Tester):
session.execute(("CREATE MATERIALIZED VIEW t_by_v AS SELECT * FROM t "
"WHERE v IS NOT NULL AND id IS NOT NULL PRIMARY KEY (v, id)"))
+ debug("Wait and ensure the MV build has started. Waiting up to 2 minutes.")
+ self._wait_for_view_build_start(session, 'ks', 't_by_v', wait_minutes=2)
+
debug("Stopping all running view build tasks with nodetool")
for node in nodes:
node.watch_log_for('Starting new view build for range', filename='debug.log', timeout=60)
@@ -1163,7 +1172,7 @@ class TestMaterializedViews(Tester):
self.check_logs_for_errors()
debug("Check that MV shouldn't be built yet.")
- self.assertNotEqual(len(list(session.execute("SELECT COUNT(*) FROM t_by_v"))), 10000)
+ self.assertNotEqual(len(list(session.execute("SELECT COUNT(*) FROM t_by_v"))), 5000)
debug("Restart the cluster")
self.cluster.stop()
@@ -1173,7 +1182,7 @@ class TestMaterializedViews(Tester):
debug("Verify that the MV has been successfully created")
self._wait_for_view('ks', 't_by_v')
- assert_one(session, "SELECT COUNT(*) FROM ks.t_by_v", [10000])
+ assert_one(session, "SELECT COUNT(*) FROM ks.t_by_v", [5000])
debug("Checking logs to verify that the view build has been resumed and completed after restart")
for node, mark in zip(nodes, marks):
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org