This will result in new tables having at least 10 tablet replicas per shard by default. We want this to reduce tablet load imbalance due to differences in tablet count per shard, where some shards have 1 tablet and some shards have 2 tablets. With higher tablet count per shard, this difference-by-one is less relevant. Fixes #21967 In some tests, we explicity set the initial scale to 1 as some of the existing tests assume 1 compaction group per shard. test.py uses a lower default. Having many tablets per shard slows down certain topology operations like decommission/replace/removenode, where the running time is proportional to tablet count, not data size, because constant cost (latency) of migration dominates. This latency is due to group0 operations and barriers. This is especially pronounced in debug mode. Scheduler allows at most 2 migrations per shard, so this latency becomes a determining factor for decommission speed. To avoid this problem in tests, we use lower default for tablet count per shard, 2 in debug/dev mode and 4 in release mode. Alternatively, we could compensate by allowing more concurrency when migrating small tablets, but there's no infrastructure for that yet. I observed that with 10 tablets per shard, debug-mode topology_custom.mv/test_mv_topology_change starts to time-out during removenode (30 s).
Tests for the Scylla REST API.
Tests use the requests library and the pytest frameworks (both are available from Linux distributions, or with "pip install").
To run all tests using test.py, just run ./test.py api/run.
To run all tests against an already-running local installation of Scylla,
just run pytest. The "--host" and "--api-port"
can be used to give a different location for the running Scylla.
More conveniently, we have a script - "run" - which does all the work necessary to start Scylla, and run the tests on it. The Scylla process is run in a temporary directory which is automatically deleted when the test ends.
"run" automatically picks the most recently compiled version of Scylla in
build/*/scylla - but this choice of Scylla executable can be overridden with
the SCYLLA environment variable.
Additional options can be passed to "pytest" or to "run" to control which tests to run:
- To run all tests in a single file, do
pytest test_system.py. - To run a single specific test, do
pytest test_system.py::test_system_uptime_ms. - To run the same test or tests 100 times, add the
--count=100option. This is faster than runningrun100 times, because Scylla is only run once, and also counts for you how many of the runs failed. Forpytestto support the--countoption, you need to install a pytest extension:pip install pytest-repeat
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)