If a query, either a write, or a read to a strongly consistent table, times out, we immediately abort the operation and throw an exception. Unfortunately, due to the inconsistency in exception types thrown on timeout by the many methods we use in the code, it results in pretty messy `try-catch` clauses. Perhaps there's a better alternative to this, but it's beyond the scope of this work, so we leave it as-is. We provide a validation test that consists of three cases corresponding to reads, writes, and waiting for the leader. They verify that the code works as expected in all affected places. A comparison of time spent on the whole `test_strong_consistency.py` on my local machine, in dev mode: Before: ``` real 0m32.185s user 0m55.391s sys 0m15.745s ``` After: ``` real 0m30.841s user 1m3.294s sys 0m21.091s ``` The time spent on the new test only: ``` real 0m7.077s user 0m35.359s sys 0m3.717s ```
Scylla in-source tests.
For details on how to run the tests, see docs/dev/testing.md
Shared C++ utils, libraries are in lib/, for Python - pylib/
alternator - Python tests which connect to a single server and use the DynamoDB API unit, boost, raft - unit tests in C++ cqlpy - Python tests which connect to a single server and use CQL topology* - tests that set up clusters and add/remove nodes cql - approval tests that use CQL and pre-recorded output rest_api - tests for Scylla REST API Port 9000 scylla-gdb - tests for scylla-gdb.py helper script nodetool - tests for C++ implementation of nodetool
If you can use an existing folder, consider adding your test to it. New folders should be used for new large categories/subsystems, or when the test environment is significantly different from some existing suite, e.g. you plan to start scylladb with different configuration, and you intend to add many tests and would like them to reuse an existing Scylla cluster (clusters can be reused for tests within the same folder).
To add a new folder, create a new directory, and then
copy & edit its suite.ini.