Skip to content

Commit

Permalink
STAR-386 Increase client timeout for test_simultaneous_bootstrap (#37)
Browse files Browse the repository at this point in the history
Improve reliability for slow/loaded test systems by using larger client timeout executing query.

(cherry picked from commit 18d05f6)
(cherry picked from commit 0bc8d67)
(cherry picked from commit fbea8a1)
  • Loading branch information
djatnieks authored and jacek-lewandowski committed May 27, 2022
1 parent c04b7de commit bdb7d26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions bootstrap_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,10 +883,9 @@ def test_simultaneous_bootstrap(self):
# Repeat the select count(*) query, to help catch
# bugs like 9484, where count(*) fails at higher
# data loads.
logger.error(node1.nodetool('status').stdout)
for _ in range(5):
logger.error("Executing SELECT to node2")
assert_one(session, "SELECT count(*) from keyspace1.standard1", [500000], cl=ConsistencyLevel.ONE)
# Improve reliability for slower/loaded test systems by using larger client timeout
assert_one(session, "SELECT count(*) from keyspace1.standard1", [500000], cl=ConsistencyLevel.ONE, timeout=30)

def test_cleanup(self):
"""
Expand Down
4 changes: 2 additions & 2 deletions tools/assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def assert_unauthorized(session, query, message):
assert_exception(session, query, matching=message, expected=Unauthorized)


def assert_one(session, query, expected, cl=None):
def assert_one(session, query, expected, cl=None, timeout=None):
"""
Assert query returns one row.
@param session Session to use
Expand All @@ -127,7 +127,7 @@ def assert_one(session, query, expected, cl=None):
assert_one(session, query, [0, 0])
"""
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)
assert list_res == [expected], "Expected {} from {}, but got {}".format([expected], query, list_res)

Expand Down

0 comments on commit bdb7d26

Please sign in to comment.