Cassandra Distributed Tests
Python Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin known_failure decorator tracks annotations as a list of dicts. Update… Oct 5, 2016
byteman CASSANDRA-10130 (#1486) Jun 26, 2017
cassandra-thrift
conf skip replace_address_test tests on small instances Aug 15, 2016
cqlsh_tests
doxygen Make doxygen html look nicer Jul 29, 2015
lib Add jolokia license to lib/ May 11, 2015
meta_tests add tests for new behavior Nov 9, 2016
plugins
repair_tests CASSANDRA-9143 change needs dtest change Jun 19, 2017
thrift_bindings bulk isort Mar 23, 2016
tools
upgrade_tests Add dtests for compatibility flag introduced in CASSANDRA-13004 (#1485) Jun 20, 2017
.gitignore
.isort.cfg tools reorg and paging dedupe (#1261) Aug 26, 2016
.travis.yml Adds assert_stderr_clean for ignoring safe errors on OS X(#1248) Aug 26, 2016
CONTRIBUTING.md Remove all uses of known failure annotation Nov 30, 2016
INSTALL.md Removed cluster reuse from codebase Jun 20, 2017
LICENSE Add Apache 2.0 License file Aug 10, 2015
README.md Push readme update Jul 13, 2017
auth_test.py Add dtest for CASSANDRA-13053 Mar 8, 2017
batch_test.py Fix do_upgrade in batch_test.py to upgrade to the current version Jul 5, 2017
bootstrap_test.py Make simple_bootstrap_test_small_keepalive_period faster/predictable … Mar 31, 2017
cdc_test.py Modify tests to not run anything thrift related on 4.0 Dec 12, 2016
cfid_test.py Move create_ks and create_cf to top level functions Sep 27, 2016
commitlog_test.py Fix flake errors Dec 13, 2016
compaction_test.py convert avg compaction throughput to mbs before compaing to threshold ( Feb 2, 2017
compression_test.py Move create_ks and create_cf to top level functions Sep 27, 2016
concurrent_schema_changes_test.py
configuration_test.py
consistency_test.py Remove all uses of known failure annotation Nov 30, 2016
consistent_bootstrap_test.py Move create_ks and create_cf to top level functions Sep 27, 2016
counter_tests.py Move create_ks and create_cf to top level functions Sep 27, 2016
cql_prepared_test.py Move create_ks and create_cf to top level functions Sep 27, 2016
cql_tests.py
cql_tracing_test.py Move create_ks and create_cf to top level functions Sep 27, 2016
delete_insert_test.py Move create_ks and create_cf to top level functions Sep 27, 2016
deletion_test.py Move create_ks and create_cf to top level functions Sep 27, 2016
disk_balance_test.py
dtest.py
env.txt update call sites to use new ccm subprocess API (#1147) Aug 4, 2016
findlibjemalloc.sh Improve startup time by prelocating libjemalloc Jun 23, 2016
global_row_key_cache_test.py
hintedhandoff_test.py Hinted handoff setmaxwindow test should only run on versions >= 4.0 May 30, 2017
internode_ssl_test.py Remove all uses of known failure annotation Nov 30, 2016
jmx_auth_test.py Expect LooseVersion from ccm version() calls (#1318) Sep 16, 2016
jmx_test.py Add a test for CASSANDRA-13346 (#1467) Jul 7, 2017
json_test.py Expect LooseVersion from ccm version() calls (#1318) Sep 16, 2016
json_tools_test.py Remove all uses of known failure annotation Nov 30, 2016
largecolumn_test.py
license.txt permissions May 30, 2014
linter_check.sh
materialized_views_test.py Fix for materialized_views_tests to wait for the build to finish befo… Mar 9, 2017
metadata_tests.py Fix flake errors Dec 13, 2016
mixed_version_test.py
multidc_putget_test.py
native_transport_ssl_test.py Move create_ks and create_cf to top level functions Sep 27, 2016
nodetool_test.py Add tests for 'nodetool getbatchlogreplaythrottle' and 'nodetool setb… Jul 6, 2017
offline_tools_test.py Reformated git install formatting from, 'git:cassandra-2.2', to, 'git… Jun 12, 2017
paging_test.py fix in correct syntax in paging_test.TestPagingData.test_select_in_cl… Feb 16, 2017
paxos_tests.py Move create_ks and create_cf to top level functions Sep 27, 2016
pending_range_test.py Move create_ks and create_cf to top level functions Sep 27, 2016
prepared_statements_test.py bulk isort Mar 23, 2016
pushed_notifications_test.py
putget_test.py
range_ghost_test.py Move create_ks and create_cf to top level functions Sep 27, 2016
read_failures_test.py Fix read_failures_test to handle ReadTimeout, retries, and driver-loc… Jan 31, 2017
read_repair_test.py
rebuild_test.py Fix flake errors Dec 13, 2016
replace_address_test.py
replication_test.py
requirements.txt Bump CCM version to 2.6.3 Jun 2, 2017
run_dtests.py
schema_metadata_test.py Move create_ks and create_cf to top level functions Sep 27, 2016
schema_test.py A new test for CASSANDRA-12582 Oct 10, 2016
scrub_test.py
secondary_indexes_test.py CASSANDRA-10130 (#1486) Jun 26, 2017
snapshot_test.py CASSANDRA-13483: fixed test failure in snapshot_test.TestSnapshot.tes… May 2, 2017
snitch_test.py Populate rows in test_multidatacenter_local_quorum so that read_itera… Jan 18, 2017
sslnodetonode_test.py add test to confirm that hostname validation is working May 30, 2017
sstable_generation_loading_test.py CASSANDRA-10130 (#1486) Jun 26, 2017
sstablesplit_test.py Fix flake errors Dec 13, 2016
sstableutil_test.py Add a sleep after compaction to give it time before checking SSTable … May 16, 2017
stress_tool_test.py tools reorg and paging dedupe (#1261) Aug 26, 2016
super_column_cache_test.py Modify tests to not run anything thrift related on 4.0 Dec 12, 2016
super_counter_test.py Fix flake errors Dec 13, 2016
thrift_hsha_test.py Fix flake errors Dec 13, 2016
thrift_tests.py
token_generator_test.py
topology_test.py
ttl_test.py Move create_ks and create_cf to top level functions Sep 27, 2016
udtencoding_test.py Move create_ks and create_cf to top level functions Sep 27, 2016
upgrade_crc_check_chance_test.py Reformated git install formatting from, 'git:cassandra-2.2', to, 'git… Jun 12, 2017
upgrade_internal_auth_test.py Reformated git install formatting from, 'git:cassandra-2.2', to, 'git… Jun 12, 2017
user_functions_test.py
user_types_test.py
wide_rows_test.py Move create_ks and create_cf to top level functions Sep 27, 2016
write_failures_test.py Modify tests to not run anything thrift related on 4.0 Dec 12, 2016

README.md

Warning: You should be committing to the ASF dtest repo, not here. Mirror at github.com/apache/cassandra-dtest.

Cassandra Distributed Tests

Tests for Apache Cassandra clusters.

Prerequisites

An up to date copy of ccm should be installed for starting and stopping Cassandra. The tests are run using nosetests. These tests require the datastax python driver. A few tests still require the deprecated python CQL over thrift driver.

Usage

The tests are run by nosetests. The only thing the framework needs to know is the location of the (compiled) sources for Cassandra. There are two options:

Use existing sources:

CASSANDRA_DIR=~/path/to/cassandra nosetests

Use ccm ability to download/compile released sources from archives.apache.org:

CASSANDRA_VERSION=1.0.0 nosetests

A convenient option if tests are regularly run against the same existing directory is to set a default_dir in ~/.cassandra-dtest. Create the file and set it to something like:

[main]
default_dir=~/path/to/cassandra

The tests will use this directory by default, avoiding the need for any environment variable (that still will have precedence if given though).

Existing tests are probably the best place to start to look at how to write tests.

Each test spawns a new fresh cluster and tears it down after the test. If a test fails, the logs for the node are saved in a logs/<timestamp> directory for analysis (it's not perfect but has been good enough so far, I'm open to better suggestions).

To run the upgrade tests, you have must both JDK7 and JDK8 installed. Paths to these installations should be defined in the environment variables JAVA7_HOME and JAVA8_HOME, respectively.

Installation Instructions

See more detailed instructions in the included INSTALL file.

Writing Tests

  • Most of the time when you start a cluster with cluster.start(), you'll want to pass in wait_for_binary_proto=True so the call blocks until the cluster is ready to accept CQL connections. We tried setting this to True by default once, but the problems caused there (e.g. when it waited the full timeout time on a node that was deliberately down) were more unpleasant and more difficult to debug than the problems caused by having it False by default.
  • If you're using JMX via the tools.jmxutils module, make sure to call remove_perf_disable_shared_mem on the node or nodes you want to query with JMX before starting the nodes. remove_perf_disable_shared_mem disables a JVM option that's incompatible with JMX (see this JMX ticket). It works by performing a string replacement in the node's Cassandra startup script, so changes will only propagate to the node at startup time.

If you'd like to know what to expect during a code review, please see the included CONTRIBUTING file.