Fix timeouts at TestAuthUpgrade.upgrade_to_22_test and 
TestAuthUpgrade.upgrade_to_30_test


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

Branch: refs/heads/master
Commit: 704c7b062d263c3b646bbb7d7cbd967279d8a31c
Parents: 864f956
Author: adelapena <[email protected]>
Authored: Mon Apr 3 13:20:23 2017 +0100
Committer: Philip Thompson <[email protected]>
Committed: Thu Apr 6 11:54:53 2017 -0400

----------------------------------------------------------------------
 tools/assertions.py           |  5 +++--
 upgrade_internal_auth_test.py | 12 +++++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/704c7b06/tools/assertions.py
----------------------------------------------------------------------
diff --git a/tools/assertions.py b/tools/assertions.py
index b7e5d09..2e88067 100644
--- a/tools/assertions.py
+++ b/tools/assertions.py
@@ -147,7 +147,7 @@ def assert_none(session, query, cl=None):
     assert list_res == [], "Expected nothing from {}, but got 
{}".format(query, list_res)
 
 
-def assert_all(session, query, expected, cl=None, ignore_order=False):
+def assert_all(session, query, expected, cl=None, ignore_order=False, 
timeout=None):
     """
     Assert query returns all expected items optionally in the correct order
     @param session Session in use
@@ -155,13 +155,14 @@ def assert_all(session, query, expected, cl=None, 
ignore_order=False):
     @param expected Expected results from query
     @param cl Optional Consistency Level setting. Default ONE
     @param ignore_order Optional boolean flag determining whether response is 
ordered
+    @param timeout Optional query timeout, in seconds
 
     Examples:
     assert_all(session, "LIST USERS", [['aleksey', False], ['cassandra', 
True]])
     assert_all(self.session1, "SELECT * FROM ttl_table;", [[1, 42, 1, 1]])
     """
     simple_query = SimpleStatement(query, consistency_level=cl)
-    res = session.execute(simple_query)
+    res = session.execute(simple_query) if timeout is None else 
session.execute(simple_query, timeout=timeout)
     list_res = _rows_to_list(res)
     if ignore_order:
         expected = sorted(expected)

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/704c7b06/upgrade_internal_auth_test.py
----------------------------------------------------------------------
diff --git a/upgrade_internal_auth_test.py b/upgrade_internal_auth_test.py
index ed34452..2c5681d 100644
--- a/upgrade_internal_auth_test.py
+++ b/upgrade_internal_auth_test.py
@@ -145,9 +145,9 @@ class TestAuthUpgrade(Tester):
 
         # we should now be able to drop the old auth tables
         session = self.patient_cql_connection(node1, user='cassandra', 
password='cassandra')
-        session.execute('DROP TABLE system_auth.users')
-        session.execute('DROP TABLE system_auth.credentials')
-        session.execute('DROP TABLE system_auth.permissions')
+        session.execute('DROP TABLE system_auth.users', timeout=60)
+        session.execute('DROP TABLE system_auth.credentials', timeout=60)
+        session.execute('DROP TABLE system_auth.permissions', timeout=60)
         # and we should still be able to authenticate and check authorization
         self.check_permissions(node1, True)
         debug('Test completed successfully')
@@ -163,12 +163,14 @@ class TestAuthUpgrade(Tester):
             assert_all(klaus,
                        'LIST ALL PERMISSIONS',
                        [['michael', '<table ks.cf1>', 'MODIFY'],
-                        ['michael', '<table ks.cf2>', 'SELECT']])
+                        ['michael', '<table ks.cf2>', 'SELECT']],
+                       timeout=60)
         else:
             assert_all(klaus,
                        'LIST ALL PERMISSIONS',
                        [['michael', 'michael', '<table ks.cf1>', 'MODIFY'],
-                        ['michael', 'michael', '<table ks.cf2>', 'SELECT']])
+                        ['michael', 'michael', '<table ks.cf2>', 'SELECT']],
+                       timeout=60)
 
         klaus.cluster.shutdown()
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to