Skip to content
Cassandra Distributed Tests
Python
Latest commit 638167f May 27, 2016 @beobal beobal Mark secondary index test as flaky
See CASSANDRA-11729
Failed to load latest commit information.
bin change os.environ so it's used in nose.main May 25, 2016
cassandra-thrift Restore thrift interface for slice test Aug 22, 2014
conf exclude some replication tests so they can run on the large dtest job May 20, 2016
cqlsh_tests added annotation for 11895 May 26, 2016
doxygen Make doxygen html look nicer Jul 29, 2015
lib Add jolokia license to lib/ May 11, 2015
plugins add plugin & runner for global configuration Feb 22, 2016
repair_tests Add 11836 annotation May 18, 2016
thrift_bindings bulk isort Mar 23, 2016
upgrade_tests 3.6 branch is still alive until 3.6 release May 25, 2016
utils add self-updating metadata wrapper to cql_tests Mar 7, 2016
.gitignore Add cassandra-attack.jar from CASSANDRA-6285 May 9, 2015
.isort.cfg add isort config to know ccm and cassandra as non-local imports Mar 23, 2016
.travis.yml Disable line length check for json_test.py Apr 21, 2016
CONTRIBUTING.md Add note on flake8 commit hook Mar 30, 2016
INSTALL.md Mention jdk 8 in install docs, not 7 Apr 4, 2016
LICENSE Add Apache 2.0 License file Aug 10, 2015
README.md Add jdk switching Jun 25, 2015
assertions.py bulk isort Mar 23, 2016
auth_test.py Improve error reporting in auth_test.py. Update error format in auth_… May 25, 2016
batch_test.py bulk isort Mar 23, 2016
bootstrap_test.py Merge pull request #967 from krummas/marcuse/11673 May 3, 2016
cfid_test.py bulk isort Mar 23, 2016
commitlog_test.py Address review comments May 26, 2016
compaction_test.py Revert "Never purge tombstones longer test" May 27, 2016
compression_test.py bulk isort Mar 23, 2016
concurrent_schema_changes_test.py Move @known_failure annotations first Apr 5, 2016
configuration_test.py Fix test for CASSANDRA-10902 Apr 8, 2016
consistency_test.py unknow CASSANDRA-11496 Apr 21, 2016
consistent_bootstrap_test.py Make changes to tests based on CCM node start API changes Mar 14, 2016
counter_tests.py bulk isort Mar 23, 2016
cql_prepared_test.py bulk isort Mar 23, 2016
cql_tests.py fix 11909 May 27, 2016
cql_tracing_test.py Skip flaky part of tracing test on 2.1 May 26, 2016
datahelp.py bulk isort Mar 23, 2016
delete_insert_test.py Make the cluster start/connect in delete_insert more patient Feb 22, 2016
deletion_test.py don't set unnecessary intermediate `result` values Mar 17, 2016
disk_balance_test.py remove asserts that test vnode allocation distribution Apr 26, 2016
dtest.py add code to predetermine C* version in dtest May 25, 2016
global_row_key_cache_test.py bulk isort Mar 23, 2016
hintedhandoff_test.py Add 11902 annotation May 26, 2016
internode_ssl_test.py known failure for cassandra-11689 Apr 29, 2016
jmx_auth_test.py known failure for cassandra-11730 May 6, 2016
jmx_test.py Move @known_failure annotations first Apr 5, 2016
jmxmetrics_test.py add notes for known failures Mar 24, 2016
jmxutils.py Add test for CASSANDRA-10091 May 2, 2016
json_test.py remove known failures related to CASSANDRA-11650 Apr 28, 2016
json_tools_test.py Remove all pre 2.1 logic Nov 13, 2015
largecolumn_test.py Add 11838 annotation May 18, 2016
license.txt permissions May 30, 2014
linter_check.sh .travis.yml: Be a little more strict with the lint checker Jan 18, 2016
materialized_views_test.py known failure for cassandra-11698 May 2, 2016
metadata_tests.py Move @known_failure annotations first Apr 5, 2016
mixed_version_test.py bulk isort Mar 23, 2016
multidc_putget_test.py Fix PEP-8 violations Jul 20, 2015
native_transport_ssl_test.py remove @since(3.0) as C* patch is now against 2.1 Nov 30, 2015
nodetool_test.py bulk isort Mar 23, 2016
offline_tools_test.py bulk isort Mar 23, 2016
paging_test.py Fix typo in error message May 24, 2016
paxos_tests.py bulk isort Mar 23, 2016
pending_range_test.py bulk isort Mar 23, 2016
prepared_statements_test.py bulk isort Mar 23, 2016
pushed_notifications_test.py known failure cassandra-11731 May 6, 2016
putget_test.py bulk isort Mar 23, 2016
range_ghost_test.py bulk isort Mar 23, 2016
read_repair_test.py Improve assert in 11427 test May 10, 2016
rebuild_test.py known failure for CASSANDRA-11687 Apr 29, 2016
replace_address_test.py changed a windows failure marked as systemic May 25, 2016
replication_test.py exclude some replication tests so they can run on the large dtest job May 20, 2016
requirements.txt change assertion logic for ">0 mutations replayed" Apr 21, 2016
run_dtests.py remove confusing unused nose_argv .format arg Mar 29, 2016
schema_metadata_test.py bulk isort Mar 23, 2016
schema_test.py bulk isort Mar 23, 2016
scrub_test.py known failure for cassandra-11693 Apr 29, 2016
secondary_indexes_test.py Mark secondary index test as flaky May 27, 2016
snapshot_test.py Add 11811 annotation May 16, 2016
snitch_test.py Make sure broadcast address is used in seed list Apr 27, 2016
sslkeytool.py Add ssl node-to-node encryption test Feb 15, 2016
sslnodetonode_test.py Add known_failure for CASSANDRA-11506 Apr 5, 2016
sstable_generation_loading_test.py Clean up linter errors on sstable_generation May 26, 2016
sstablesplit_test.py Remove all pre 2.1 logic Nov 13, 2015
sstableutil_test.py CASSANDRA-11692: do not check final files after aborted compaction May 2, 2016
stress_tool_test.py Use autopep8 to cleanup dtest Sep 9, 2015
super_column_cache_test.py bulk isort Mar 23, 2016
super_counter_test.py bulk isort Mar 23, 2016
thrift_hsha_test.py bulk isort Mar 23, 2016
thrift_tests.py Remove unused import May 24, 2016
token_generator.py bulk isort Mar 23, 2016
tools.py add RerunTestException and enable for one test Apr 29, 2016
topology_test.py Remove 11837 annotation, was just fixed by #979 May 19, 2016
ttl_test.py bulk isort Mar 23, 2016
udtencoding_test.py bulk isort Mar 23, 2016
upgrade_crc_check_chance_test.py known failure for cassandra-11699 May 2, 2016
upgrade_internal_auth_test.py Move @known_failure annotations first Apr 5, 2016
upgrade_supercolumns_test.py add RerunTestException and enable for one test Apr 29, 2016
user_functions_test.py use new CASSANDRA_VERSION_FROM_BUILD constant May 25, 2016
user_types_test.py Improve error reporting in auth_test.py. Update error format in auth_… May 25, 2016
wide_rows_test.py bulk isort Mar 23, 2016
write_failures_test.py Set test_mutation_v2 to only run on 2.2.x Feb 16, 2016

README.md

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, unless REUSE_CLUSTER is set to true. Then some tests will share cassandra instances. 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 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.

Something went wrong with that request. Please try again.