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 Use new syntax introduced in 5357. Old will be removed in 3.0
doxygen Make doxygen html look nicer
lib Add jolokia license to lib/
thrift_bindings Regen thrift bindings for CASSANDRA-9352
.gitignore Add cassandra-attack.jar from CASSANDRA-6285
.travis.yml disables sudo for travis builds
CONTRIBUTING.md Change all instances of cursor to session
INSTALL.md adds instructions for flaky to INSTALL
README.md Add jdk switching
assertions.py Fix PEP-8 violations
auth_roles_test.py Revert "patch for CASSANDRA-9889"
auth_test.py Change all instances of cursor to session
batch_test.py Clean up dtest for output of pyflakes
bootstrap_test.py Reverted to default timeout for CASSANDRA-9765 tests, to see if it he…
cfid_test.py Change all instances of cursor to session
commitlog_test.py remove skips from commitlog_test
compaction_test.py Fix PEP-8 violations
concurrent_schema_changes_test.py Change all instances of cursor to session
configuration_test.py added missing line to configuration_test.change_durable_writes_test (…
consistency_test.py Isort and PEP8 consistency_test.py
consistent_bootstrap_test.py Style fixes
counter_tests.py Fix PEP-8 violations
cql_prepared_test.py Fix PEP-8 violations
cql_tests.py Skip all tests for features in dev. Remove require...
datahelp.py Change all instances of cursor to session
delete_insert_test.py Style fixes to delete_insert_test
deletion_test.py Fixed tests for CASSANDRA-9448
deprecated_cql_tests.py Change all instances of cursor to session
deprecated_repair_test.py Change all instances of cursor to session
dtest.py Merge pull request #432 from pauloricardomg/9902-v3
global_row_key_cache_test.py Change all instances of cursor to session
hintedhandoff_test.py Change all instances of cursor to session
incremental_repair_test.py Realize the function is actually a decorator
index_summary_upgrade_test.py Adjust JVM options to fix Jolokia agent problems
internode_ssl_test.py switched from str % to .format and switched to doxygen comment @tags
jmx_test.py For CASSANDRA-9741, try further reducing the number of threads to avo…
jmxmetrics_test.py Use new syntax introduced in 5357. Old will be removed in 3.0
jmxutils.py added tools.jar to jolokia classpath if $JAVA_HOME env var present on…
json_test.py Convert CRLF to LF in cqlsh_print on Windows.
json_tools_test.py Style fixes for json_tools_test
largecolumn_test.py Style fixes to largecolumn_test
license.txt permissions
linter_check.sh Add linter_check.sh
materialized_views_test.py try to fix the batchlog insert issue on a single node
metadata_tests.py Hard skip hanging test
mixed_version_test.py Use cassandra-2.2 instead of trunk for upgrade
multidc_putget_test.py Fix PEP-8 violations
offline_tools_test.py Wait for compactions, so our assumptions about levels are valid
paging_test.py unrequire test_ttl_deletions
paxos_tests.py organize paxos_tests imports with isort
prepared_statements_test.py Clean up dtest for output of pyflakes
pushed_notifications_test.py Change all instances of cursor to session
putget_test.py Change all instances of cursor to session
range_ghost_test.py Change all instances of cursor to session
read_repair_test.py Change all instances of cursor to session
rebuild_test.py Skip all tests for features in dev. Remove require...
repair_test.py Skip all tests for features in dev. Remove require...
replace_address_test.py Fix PEP-8 Violations
replication_test.py Fix PEP-8 Violations
requirements.txt Add psutil to req.txt
schema_test.py Fix PEP-8 Violations
scrub_test.py Don't make assumptions about nodetool behavior on windows
secondary_indexes_test.py Fix PEP-8 Violations
snapshot_test.py For CASSANDRA-9868, test is sensitive to filesystem iteration order. …
sstable_generation_loading_test.py Fix PEP-8 Violations
sstablelist_test.py Skip all tests for features in dev. Remove require...
sstablesplit_test.py Fix PEP-8 Violations
stress_tool_test.py makes exclusive connection non-exclusive
super_column_cache_test.py Fix thrift_bindings imports
super_counter_test.py Fix PEP-8 Violations
thrift_hsha_test.py Fix PEP-8 Violations
thrift_tests.py Skip all tests for features in dev. Remove require...
token_generator.py Fix PEP-8 Violations
tools.py switched from str % to .format and switched to doxygen comment @tags
topology_test.py Skip all tests for features in dev. Remove require...
ttl_test.py Change all instances of cursor to session
udtencoding_test.py Fix broken udt_test quotes syntax
upgrade_internal_auth_test.py sorts imports in upgrade_internal_auth_test
upgrade_supercolumns_test.py fix "Invalid yaml. Please remove properties [memtable_allocation_type…
upgrade_through_versions_test.py upgrade tests to ignore rejected execution exception
user_functions_test.py cleans up whitespace in user_functions_test
user_types_test.py Skip all tests for features in dev. Remove require...
wide_rows_test.py Fix PEP-8 Violations
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.