Skip to content
Cassandra Distributed Tests
Python
Failed to load latest commit information.
bin add failure_notes to collect_known_failures output
cassandra-thrift Restore thrift interface for slice test
conf Exclude single_partition_consistent_reads_after_write_test during cov…
cqlsh_tests Add annotation for CASSANDRA-11121
doxygen Make doxygen html look nicer
lib Add jolokia license to lib/
thrift_bindings Regen thrift bindings for CASSANDRA-9352
upgrade_tests re-introduce Windows logic
.gitignore Add cassandra-attack.jar from CASSANDRA-6285
.travis.yml .travis.yml: Be a little more strict with the lint checker
CONTRIBUTING.md add some basic stuff to the checklist
INSTALL.md add more information about driver installation
LICENSE Add Apache 2.0 License file
README.md Add jdk switching
assertions.py Don't require an error_message kwarg for assert_almost_equal
auth_test.py Merge auth_roles_test.py into auth_test.py
batch_test.py remove unnecessary redefinition of debug
bootstrap_test.py Change 10912 failure source
cfid_test.py even more multi datadir fixes
commitlog_test.py Define node path in commit log tests. Accidentally removed in 112b851
compaction_test.py Merge pull request #760 from krummas/marcuse/datadirs
compression_test.py even more multi datadir fixes
concurrent_schema_changes_test.py PEP8 Fixes
configuration_test.py Add test for 10902
consistency_test.py Ensure node is totally up before continuing with test
consistent_bootstrap_test.py Mark consistent_reads test as known_failure
counter_tests.py Fixes after driver upgrade, batch 4
cql_prepared_test.py Use autopep8 to cleanup dtest
cql_tests.py Update link for large_collection test failure
datahelp.py Change all instances of cursor to session
delete_insert_test.py Use autopep8 to cleanup dtest
deletion_test.py Remove all pre 2.1 logic
deprecated_repair_test.py Use autopep8 to cleanup dtest
disk_balance_test.py Extending fix from 18f2f68 to another test
dtest.py Block on traces in replication_test.py
global_row_key_cache_test.py tag failing global row key cache test
hintedhandoff_test.py Make some pep8 fixes
incremental_repair_test.py Revert "unskip multiple_subsequent_repair_test after #9752"
index_summary_upgrade_test.py Add known failure annotation for 11127
internode_ssl_test.py Add test for internode_compression: 'none'
jmx_test.py Remove annotation for 10913. It is resolved.
jmxmetrics_test.py PEP8 Fixes
jmxutils.py Revert "Totally undo changes for 10494. Revert once that is committed."
json_test.py Fixes to support microseconds in the default timestamp format, CASSAN…
json_tools_test.py Remove all pre 2.1 logic
largecolumn_test.py Make test of number work with negative numbers
license.txt permissions
linter_check.sh .travis.yml: Be a little more strict with the lint checker
materialized_views_test.py Bump materialized view migration timeout up (again) to 5s
metadata_tests.py don't @require hanging metadata test
mixed_version_test.py Use autopep8 to cleanup dtest
multidc_putget_test.py Fix PEP-8 violations
native_transport_ssl_test.py remove @since(3.0) as C* patch is now against 2.1
nodetool_test.py Add missing @since to new nodetool test
offline_tools_test.py comment on selection of amount of data to write
paging_test.py Restrict test for 10010 to 2.2.6+
paxos_tests.py Use autopep8 to cleanup dtest
pending_range_test.py Add test for CASSANDRA-10887
prepared_statements_test.py Remove all pre 2.1 logic
pushed_notifications_test.py Remove annotation for 10870
putget_test.py Use autopep8 to cleanup dtest
range_ghost_test.py Fixes after driver upgrade, batch 7
read_repair_test.py make flake8 happy
rebuild_test.py Fix 'boostrap' typo across all tests
repair_test.py 10860 is resolved. Removing known_failure
replace_address_test.py Remove all pre 2.1 logic
replication_test.py Block on traces in replication_test.py
requirements.txt Add psutil to req.txt
schema_metadata_test.py rename function to better suit purpose
schema_test.py fixed up schema alteration test
scrub_test.py clean up the way we iterate over data directories
secondary_indexes_test.py Remove 10905 annotation.
snapshot_test.py Count data dirs, to solve 'x not defined' error
snitch_test.py Restrict snitch_test.py appropriately for 9748
sstable_generation_loading_test.py clean up the way we iterate over data directories
sstablesplit_test.py Remove all pre 2.1 logic
sstableutil_test.py Remove 10919 annotation
stress_tool_test.py Use autopep8 to cleanup dtest
super_column_cache_test.py Fix thrift_bindings imports
super_counter_test.py Remove annotation for 10893. Resolved.
thrift_hsha_test.py Use jmx instead of lsof
thrift_tests.py Remove now unneeded import
token_generator.py Use autopep8 to cleanup dtest
tools.py docstring style fixes in tools.py
topology_test.py Add more debug output to topo.decomission test
ttl_test.py Change all instances of cursor to session
udtencoding_test.py Remove all pre 2.1 logic
upgrade_crc_check_chance_test.py added tests for verifying if crc_check_chance option is correctly mig…
upgrade_internal_auth_test.py Remove unused import
upgrade_supercolumns_test.py tag known_failures for upgrade supercolumns
upgrade_through_versions_test.py remove bad version check logic
user_functions_test.py fix dtest
user_types_test.py Use stricter CL on test_type_secondary_indexing
wide_rows_test.py Fixes after driver upgrade, batch 4
write_failures_test.py limit write_failures_test.test_mutation_v2 to C* 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.