Skip to content

HTTPS clone URL

Subversion checkout URL

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

Merge pull request #520 from pauloricardomg/repairtest_minorfix

Being more cautious with start and stop to avoid UnavailableException on repair_test
latest commit 2636e525f5
@ptnapoleon ptnapoleon authored
Failed to load latest commit information.
cassandra-thrift Restore thrift interface for slice test
conf Add conf/upgrade_through_versions_test.cfg
cqlsh_tests Revert "compaction conf dictionary vals for cqlsh describe"
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 lint against most recent common ancestor
CONTRIBUTING.md Change all instances of cursor to session
INSTALL.md Fix bad file separator on Windows, add Windows info to INSTALL.md
LICENSE Add Apache 2.0 License file
README.md Add jdk switching
assertions.py removed semicollons from assertions.py
auth_roles_test.py Revert "Revert "patch for CASSANDRA-9889""
auth_test.py Added authentication tests for materialized views (CASSANDRA-9927)
batch_test.py tests for checking warning message on logged batches on tables with g…
bootstrap_test.py C*-10205 debug: set log level before populating
cfid_test.py Change all instances of cursor to session
commitlog_test.py removed watch_log_for timeout on test_commitlog_replay_on_startup
compaction_test.py unrequire tests that pass now
compression_test.py added schema refresh and sort imports on compression_test -- CASSANDR…
concurrent_schema_changes_test.py enabled test for concurrent mv creation - CASSANDRA-10156
configuration_test.py added missing line to configuration_test.change_durable_writes_test (…
consistency_test.py Improve error message.
consistent_bootstrap_test.py Refactor insert_c1c2 to use execute_concurrent
counter_tests.py Fix PEP-8 violations
cql_prepared_test.py Fix PEP-8 violations
cql_tests.py PEP8 complaints
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 Refactor insert_c1c2 to use execute_concurrent
dtest.py Refactor _create_session
global_row_key_cache_test.py Change all instances of cursor to session
hintedhandoff_test.py Refactor insert_c1c2 to use execute_concurrent
incremental_repair_test.py Refactor insert_c1c2 to use execute_concurrent
index_summary_upgrade_test.py Adjust JVM options to fix Jolokia agent problems
internode_ssl_test.py Add test for internode_compression: 'none'
jmx_test.py Skip jmx_test:TestJMX.cfhistograms_test on Windows (15M stress)
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 Ignore whitespace differences on pkey_requirement_test
json_tools_test.py fix for CASSANDRA-10051
largecolumn_test.py Style fixes to largecolumn_test
license.txt permissions
linter_check.sh lint against most recent common ancestor
materialized_views_test.py Increased gc_grace_seconds of base table to 5s in materialized_views_…
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 Flush before stop on sstablelevelreset_test
paging_test.py Merge branch 'master' of github.com:riptano/cassandra-dtest
paxos_tests.py organize paxos_tests imports with isort
prepared_statements_test.py Clean up dtest for output of pyflakes
pushed_notifications_test.py Fix tests aborted due to a tombstone threshold reached
putget_test.py Refactor insert_c1c2 to use execute_concurrent
range_ghost_test.py Change all instances of cursor to session
read_repair_test.py minor fix for #10029
rebuild_test.py Refactor insert_c1c2 to use execute_concurrent
repair_test.py Being more cautious with start and stop to avoid UnavailableException…
replace_address_test.py skip hanging resumable_replace_test
replication_test.py Fix PEP-8 Violations
requirements.txt Add psutil to req.txt
schema_metadata_test.py Fix schema_metadata_test regression for secondary indexes
schema_test.py Fix PEP-8 Violations
scrub_test.py unrequire tests that pass now
secondary_indexes_test.py Update 2i dtest for CASSANDRA-7771
snapshot_test.py Fix bad file separator on Windows, add Windows info to INSTALL.md
sstable_generation_loading_test.py Use platform portable urandom access
sstablelist_test.py Skip all tests for features in dev. Remove require...
sstablesplit_test.py whitespace fixes in prep for unrequiring
stress_tool_test.py makes exclusive connection non-exclusive
super_column_cache_test.py Fix thrift_bindings imports
super_counter_test.py flushing before shutting down cluster on super_counter_test.py (CASSA…
thrift_hsha_test.py Fix PEP-8 Violations
thrift_tests.py Add test for multigetslice on compact table
token_generator.py Fix PEP-8 Violations
tools.py Refactor insert_c1c2 to use execute_concurrent
topology_test.py Refactor insert_c1c2 to use execute_concurrent
ttl_test.py Change all instances of cursor to session
udtencoding_test.py Fix broken udt_test quotes syntax
upgrade_internal_auth_test.py Ignoring errors before upgrade to 1.2 on Windows (CASSANDRA-10037)
upgrade_supercolumns_test.py fix "Invalid yaml. Please remove properties [memtable_allocation_type…
upgrade_through_versions_test.py upgrade test use provided protocol version
user_functions_test.py fix dtest
user_types_test.py Give time to propagate the drops
wide_rows_test.py Fix PEP-8 Violations
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.