Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Cassandra Distributed Tests
Python

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
cassandra-thrift Restore thrift interface for slice test
conf re-includes tests from replace_address_test
cqlsh_tests Fixed linter issues
doxygen Add instructions for installing doxygen
lib Add jolokia license to lib/
thrift_bindings Regen thrift bindings for CASSANDRA-9352
.gitignore Add cassandra-attack.jar from CASSANDRA-6285
.travis.yml add travis config for linting pull requests
CONTRIBUTING.md Stop telling lies about PEP-8.
INSTALL.md adds instructions for flaky to INSTALL
README.md Add jdk switching
assertions.py Add tests for normal and compressed commitlogs
auth_roles_test.py Add test for CASSANDRA-9551
auth_test.py Clean up dtest for output of pyflakes
batch_test.py Clean up dtest for output of pyflakes
bootstrap_test.py Fix initial_token for simple_bootstrap_test
cfid_test.py Clean up dtest for output of pyflakes
commitlog_test.py Switch references to version 3.0 to 2.2 for CASSANDRA-9352
compaction_test.py fix sstable_deletion tests
concurrent_schema_changes_test.py Clean up dtest for output of pyflakes
configuration_test.py s/@jira_ticket N/@jira_ticket CASSANRA-N/g
consistency_test.py Tests for CASSANDRA-9035
consistent_bootstrap_test.py Add wait_for_binary_proto on cluster startup
counter_tests.py Wait for binary proto after node restart
cql_prepared_test.py Clean up dtest for output of pyflakes
cql_tests.py Remove unused imports after PR for C*-9160
datahelp.py make it so data description can be a bit prettier
delete_insert_test.py Clean up dtest for output of pyflakes
deletion_test.py Adjust JVM options to fix Jolokia agent problems
deprecated_cql_tests.py remove require from deprecated_cql_tests
deprecated_repair_test.py Remove unused imports
dtest.py adds tools for running tests with @require
global_indexes_test.py Clean up dtest for output of pyflakes
global_row_key_cache_test.py Slow down counter updates to avoid timeouts in 2.0
hintedhandoff_test.py adds trailing newline to hintedhandoff_test.py
incremental_repair_test.py Clean up dtest for output of pyflakes
index_summary_upgrade_test.py Adjust JVM options to fix Jolokia agent problems
jmx_test.py use flaky instead of require
jmxmetrics_test.py Test to check JMX metrics
jmxutils.py Adjust JVM options to fix Jolokia agent problems
json_test.py Convert CRLF to LF in cqlsh_print on Windows.
json_tools_test.py skips sstable2json tests on 3.0+
largecolumn_test.py Clean up dtest for output of pyflakes
license.txt permissions
metadata_tests.py Ignore Unknown ks/cf errors when resetting local schema
mixed_version_test.py Use cassandra-2.2 instead of trunk for upgrade
multidc_putget_test.py Clean up dtest for output of pyflakes
offline_tools_test.py removes incorrect docstring line
paging_test.py make it so data description can be a bit prettier
paxos_tests.py Clean up dtest for output of pyflakes
prepared_statements_test.py Clean up dtest for output of pyflakes
pushed_notifications_test.py More fixes for 8099
putget_test.py Clean up dtest for output of pyflakes
range_ghost_test.py Clean up dtest for output of pyflakes
read_repair_test.py dtest for 9502
rebuild_test.py s/@jira_ticket N/@jira_ticket CASSANRA-N/g
repair_test.py organize imports in repair_test.py with isort
replace_address_test.py Clean up dtest for output of pyflakes
replication_test.py Clean up dtest for output of pyflakes
schema_test.py Remove all instances of the ignored arg 'version'
scrub_test.py Fix to run the test for CASSANDRA-9591 on trunk as well
secondary_indexes_test.py More fixes for 8099
snapshot_test.py Add wait_for_binary_proto=True to node/cluster starts
sstable_generation_loading_test.py Clean up dtest for output of pyflakes
sstablelist_test.py CASSANDRA-7066, changes for tmp files in offline tools and one small …
sstablesplit_test.py Clean up dtest for output of pyflakes
stress_tool_test.py makes exclusive connection non-exclusive
super_column_cache_test.py Fix thrift_bindings imports
super_counter_test.py Set start_rpc to True on all thrift tests
thrift_hsha_test.py adds metadata to thrift_hsha_test tests
thrift_tests.py apply isort to changed files
token_generator.py Clean up dtest for output of pyflakes
tools.py adds tools for running tests with @require
topology_test.py Clean up dtest for output of pyflakes
ttl_test.py More TTL comparison fixes
udtencoding_test.py Clean up dtest for output of pyflakes
upgrade_internal_auth_test.py Add version restriction on upgrade auth test
upgrade_supercolumns_test.py Wait for schema agreement after adding keyspace
upgrade_through_versions_test.py Add jdk switching
user_functions_test.py Clean up dtest for output of pyflakes
user_types_test.py Fix indentation mistake from 33415f
validation.py Clean up dtest for output of pyflakes
wide_rows_test.py Make ccmlib api changes for setting install_dir and version
write_failures_test.py Adjustments for version 2.2

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.