Skip to content

Commit

Permalink
cql-pytest: increase more timeouts
Browse files Browse the repository at this point in the history
In commit 7eda6b1, we increased the
request_timeout parameter used by cql-pytest tests from the default of
10 seconds to 120 seconds. 10 seconds was usually more than enough for
finishing any Scylla request, but it turned out that in some extreme
cases of a debug build running on an extremely over-committed machine,
the default timeout was not enough.

Recently, in issue #11289 we saw additional cases of timeouts which
the request_timeout setting did *not* solve. It turns out that the Python
CQL driver has two additional timeout settings - connect_timeout and
control_connection_timeout, which default to 5 seconds and 2 seconds
respectively. I believe that most of the timeouts in issue #11289
come from the control_connection_timeout setting - by changing it
to a tiny number (e.g., 0.0001) I got the same error messages as those
reported in #11289. The default of that timeout - 2 seconds - is
certainly low enough to be reached on an extremely over-committed
machine.

So this patch significantly increases both connect_timeout and
control_connection_timeout to 60 seconds. We don't care that this timeout
is ridiculously large - under normal operations it will never be reached.
There is no code which loops for this amount of time, for example.

Refs #11289 (perhaps even Fixes, we'll need to see that the test errors
go away).

NOTE: This patch only changes test/cql-pytest/util.py, which is only
used by the cql-pytest test suite. We have multiple other test suites which
copied this code, and those test suites might need fixing separately.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>

Closes #11295
  • Loading branch information
nyh authored and avikivity committed Aug 16, 2022
1 parent 0884244 commit 055340a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/cql-pytest/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ def cql_session(host, port, is_ssl, username, password):
protocol_version=4,
auth_provider=PlainTextAuthProvider(username=username, password=password),
ssl_context=ssl_context,
# The default timeout for new connections is 5 seconds, and for
# requests made by the control connection is 2 seconds. These should
# have been more than enough, but in some extreme cases with a very
# slow debug build running on a very busy machine, they may not be.
# so let's increase them to 60 seconds. See issue #11289.
connect_timeout = 60,
control_connection_timeout = 60,
)
yield cluster.connect()
cluster.shutdown()
Expand Down

0 comments on commit 055340a

Please sign in to comment.