Sometimes the cql-pytest tests run extremely slowly. This can be a combination of running the debug build (which is naturally slow) and a test machine which is overcommitted, or experiencing some transient swap storm or some similar event. We don't want tests, which we run on a 100% reliable setups, to fail just because they run into timeouts in Scylla when they run very slowly. We already noticed this problem in the past, and increased the CQL client timeout in conftest.py from the default of 10 seconds to 120 seconds - the old default of 10 seconds was not enough for some long operations (such as creating a table with multiple views) when the test ran very slowly. However, this only fixed the client-side timeout. We also have a bunch of server-side timeouts, configured to all sorts of arbitrary (and fairly small) numbers. For example, the server has a "write request timeout" option, which defaults to just 2 seconds. We recently saw this timeout exceeded in a slow run which tried to do a very large write. So this patch configures all the configurable server-side timeouts we have to default to 300 seconds. This should be more than enough for even the slowest runs (famous last words...). This default is not a good idea on real multi-node clusters which are expected to deal with node loss, but this is not the case in cql-pytest. Signed-off-by: Nadav Har'El <nyh@scylladb.com> Message-Id: <20210529213648.856503-1-nyh@scylladb.com>
Single-node funtional tests for Scylla's CQL features. Tests use the Python CQL library and the pytest frameworks. By using an actual CQL library for the tests, they can be run against any implementation of CQL - both Scylla and Cassandra. Most tests - except in rare cases - should pass on both, to ensure that Scylla is compatible with Cassandra in most features.
To run all tests against an already-running local installation of Scylla
or Cassandra on localhost, just run pytest. The "--host" and "--port"
can be used to give a different location for the running Scylla or Cassanra.
More conveniently, we have two scripts - "run" and "run-cassandra" - which do all the work necessary to start Scylla or Cassandra (respectively), and run the tests on them. The Scylla or Cassandra process is run in a temporary directory which is automatically deleted when the test ends.
Additional options can be passed to "pytest" or to "run" / "run-cassandra" to control which tests to run:
- To run all tests in a single file, do
pytest test_table.py. - To run a single specific test, do
pytest test_table.py::test_create_table_unsupported_names.
Additional useful pytest options, especially useful for debugging tests:
- -v: show the names of each individual test running instead of just dots.
- -s: show the full output of running tests (by default, pytest captures the test's output and only displays it if a test fails)