Skip to content

Commit

Permalink
STAR-394: Fix various timeouts (#57)
Browse files Browse the repository at this point in the history
(cherry picked from commit adc3546)
  • Loading branch information
jacek-lewandowski committed May 24, 2022
1 parent 76028a2 commit f6c9534
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 6 additions & 3 deletions cqlsh_tests/test_cqlsh_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ def prepare(self, nodes=1, partitioner="murmur3", configuration_options=None, to

if auth_enabled:
self.node1.watch_log_for('Created default superuser')
self.session = self.patient_cql_connection(self.node1, user='cassandra', password='cassandra')
self.session = self.patient_cql_connection(self.node1, user='cassandra', password='cassandra', request_timeout=30.0)
else:
self.session = self.patient_cql_connection(self.node1)
self.session = self.patient_cql_connection(self.node1, request_timeout=30.0)

self.session.execute('DROP KEYSPACE IF EXISTS ks')
self.ks = 'ks'
Expand Down Expand Up @@ -2387,6 +2387,9 @@ def _test_bulk_round_trip(self, nodes, partitioner,
# enough for truncating larger tables, see CASSANDRA-11157
if 'truncate_request_timeout_in_ms' not in configuration_options:
configuration_options['truncate_request_timeout_in_ms'] = 60000
configuration_options['request_timeout_in_ms'] = 60000
configuration_options['read_request_timeout_in_ms'] = 60000
configuration_options['range_request_timeout_in_ms'] = 60000

self.prepare(nodes=nodes, partitioner=partitioner, configuration_options=configuration_options)

Expand All @@ -2406,7 +2409,7 @@ def create_records():
else:
count_statement = SimpleStatement("SELECT COUNT(*) FROM {}".format(stress_table), consistency_level=ConsistencyLevel.ALL,
retry_policy=FlakyRetryPolicy(max_retries=3))
ret = rows_to_list(self.session.execute(count_statement))[0][0]
ret = rows_to_list(self.session.execute(query=count_statement, timeout=60.0))[0][0]
logger.debug('Generated {} records'.format(ret))
assert ret >= num_operations, 'cassandra-stress did not import enough records'
return ret
Expand Down
6 changes: 4 additions & 2 deletions dtest_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ def _create_session(self, node, keyspace, user, password, compression, protocol_
protocol_version=protocol_version,
port=port,
ssl_options=ssl_opts,
connect_timeout=15,
connect_timeout=60,
idle_heartbeat_timeout=60,
idle_heartbeat_interval=60,
allow_beta_protocol_version=True,
execution_profiles=profiles)
session = cluster.connect(wait_for_all_pools=True)
Expand All @@ -244,7 +246,7 @@ def _create_session(self, node, keyspace, user, password, compression, protocol_
return session

def patient_cql_connection(self, node, keyspace=None,
user=None, password=None, timeout=30, compression=True,
user=None, password=None, timeout=60, compression=True,
protocol_version=None, port=None, ssl_opts=None, **kwargs):
"""
Returns a connection after it stops throwing NoHostAvailables due to not being ready.
Expand Down

0 comments on commit f6c9534

Please sign in to comment.