You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ad...@apache.org on 2022/11/03 11:47:18 UTC
[cassandra] 01/01: Merge branch 'cassandra-3.0' into cassandra-3.11
This is an automated email from the ASF dual-hosted git repository.
adelapena pushed a commit to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git
commit 7df905a4293af692b793b9364f2011f1c0a3a0d9
Merge: deede44af5 116ce3bc05
Author: Andrés de la Peña <a....@gmail.com>
AuthorDate: Thu Nov 3 11:36:22 2022 +0000
Merge branch 'cassandra-3.0' into cassandra-3.11
.circleci/config-2_1.yml | 70 ++++--
.circleci/config-2_1.yml.high_res.patch | 6 +-
.circleci/config-2_1.yml.mid_res.patch | 12 +-
.circleci/config.yml | 403 +++++++++++++++++++++++++++++--
.circleci/config.yml.HIGHRES | 413 ++++++++++++++++++++++++++++++--
.circleci/config.yml.LOWRES | 413 ++++++++++++++++++++++++++++++--
.circleci/config.yml.MIDRES | 413 ++++++++++++++++++++++++++++++--
.circleci/generate.sh | 1 +
8 files changed, 1606 insertions(+), 125 deletions(-)
diff --cc .circleci/config-2_1.yml
index c3703d699d,48bce92a3a..92dd98d332
--- a/.circleci/config-2_1.yml
+++ b/.circleci/config-2_1.yml
@@@ -109,7 -101,7 +109,6 @@@ default_env_vars: &default_env_var
# REPEATED_ANT_TEST_TARGET: test-jvm-dtest-some
# REPEATED_ANT_TEST_TARGET: test-cdc
# REPEATED_ANT_TEST_TARGET: test-compression
-- # REPEATED_ANT_TEST_TARGET: test-system-keyspace-directory
REPEATED_ANT_TEST_TARGET: testsome
# The name of JUnit class to be run multiple times, for example:
# REPEATED_ANT_TEST_CLASS: org.apache.cassandra.cql3.ViewTest
@@@ -199,7 -191,7 +198,7 @@@ separate_jobs: &separate_job
requires:
- start_j8_jvm_dtests_repeat
- build
-- # specialized unit tests (all run using Java 8)
++ # specialized unit tests (all run on request)
- start_utests_long:
type: approval
- utests_long:
@@@ -212,6 -204,6 +211,18 @@@
requires:
- start_utests_long_repeat
- build
++ - start_utests_cdc:
++ type: approval
++ - utests_cdc:
++ requires:
++ - start_utests_cdc
++ - build
++ - start_utests_cdc_repeat:
++ type: approval
++ - utests_cdc_repeat:
++ requires:
++ - start_utests_cdc_repeat
++ - build
- start_utests_compression:
type: approval
- utests_compression:
@@@ -320,7 -301,7 +331,7 @@@ pre-commit_jobs: &pre-commit_job
- j8_jvm_dtests_repeat:
requires:
- build
-- # specialized unit tests (all run on request using Java 8)
++ # specialized unit tests (all run on request)
- start_utests_long:
type: approval
- utests_long:
@@@ -331,6 -312,6 +342,16 @@@
requires:
- start_utests_long
- build
++ - start_utests_cdc:
++ type: approval
++ - utests_cdc:
++ requires:
++ - start_utests_cdc
++ - build
++ - utests_cdc_repeat:
++ requires:
++ - start_utests_cdc
++ - build
- start_utests_compression:
type: approval
- utests_compression:
@@@ -481,6 -448,6 +502,16 @@@ jobs
- run_junit_tests:
target: long-test
++ utests_cdc:
++ <<: *j8_par_executor
++ steps:
++ - attach_workspace:
++ at: /home/cassandra
++ - create_junit_containers
++ - log_environment
++ - run_parallel_junit_tests:
++ target: testclasslist-cdc
++
utests_compression:
<<: *j8_par_executor
steps:
@@@ -552,21 -511,21 +583,21 @@@
- log_environment
- run_unit_tests_repeat
-- utests_compression_repeat:
++ utests_cdc_repeat:
<<: *j8_repeated_utest_executor
steps:
- attach_workspace:
at: /home/cassandra
- log_environment
-- - run_utests_compression_repeat
++ - run_utests_cdc_repeat
-- utests_system_keyspace_directory_repeat:
++ utests_compression_repeat:
<<: *j8_repeated_utest_executor
steps:
- attach_workspace:
at: /home/cassandra
- log_environment
-- - run_utests_system_keyspace_directory_repeat
++ - run_utests_compression_repeat
utests_long_repeat:
<<: *j8_repeated_utest_executor
@@@ -984,18 -932,18 +1015,18 @@@ commands
count: ${REPEATED_UTESTS_COUNT}
stop_on_failure: ${REPEATED_TESTS_STOP_ON_FAILURE}
-- run_utests_compression_repeat:
++ run_utests_cdc_repeat:
steps:
- run_repeated_utests:
-- target: test-compression
++ target: test-cdc
tests: ${REPEATED_UTESTS}
count: ${REPEATED_UTESTS_COUNT}
stop_on_failure: ${REPEATED_TESTS_STOP_ON_FAILURE}
-- run_utests_system_keyspace_directory_repeat:
++ run_utests_compression_repeat:
steps:
- run_repeated_utests:
-- target: test-system-keyspace-directory
++ target: test-compression
tests: ${REPEATED_UTESTS}
count: ${REPEATED_UTESTS_COUNT}
stop_on_failure: ${REPEATED_TESTS_STOP_ON_FAILURE}
@@@ -1064,7 -1004,14 +1095,16 @@@
# Put manually specified tests and automatically detected tests together, removing duplicates
tests=$(echo <<parameters.tests>> | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
-
+
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=<<parameters.target>>
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -1083,9 -1030,8 +1123,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -1205,9 -1151,8 +1244,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name="-Dtest.name=$class_name"
else
name="-Dtest.name=$class_path"
diff --cc .circleci/config-2_1.yml.high_res.patch
index d2996086de,bdc37a0307..6c1ca83ea4
--- a/.circleci/config-2_1.yml.high_res.patch
+++ b/.circleci/config-2_1.yml.high_res.patch
@@@ -1,5 -1,5 +1,5 @@@
- --- config-2_1.yml 2022-10-15 14:49:08.115591764 +0100
- +++ config-2_1.yml.HIGHRES 2022-10-15 14:50:05.887981105 +0100
---- config-2_1.yml 2022-10-15 16:29:48.670020291 +0100
-+++ config-2_1.yml.HIGHRES 2022-10-15 16:30:17.885329362 +0100
++--- config-2_1.yml 2022-10-27 10:16:44.059665934 +0100
+++++ config-2_1.yml.HIGHRES 2022-10-27 10:18:01.956045811 +0100
@@ -40,8 +40,8 @@
CASSANDRA_SKIP_SYNC: true
DTEST_REPO: https://github.com/apache/cassandra-dtest.git
@@@ -11,7 -11,7 +11,7 @@@
# Whether the repeated test iterations should stop on the first failure by default.
REPEATED_TESTS_STOP_ON_FAILURE: false
- @@ -126,46 +126,50 @@
-@@ -118,46 +118,50 @@
++@@ -125,46 +125,50 @@
j8_par_executor: &j8_par_executor
executor:
name: java8-executor
diff --cc .circleci/config-2_1.yml.mid_res.patch
index 8eb567d5e4,05cf0c275e..8fce189ce8
--- a/.circleci/config-2_1.yml.mid_res.patch
+++ b/.circleci/config-2_1.yml.mid_res.patch
@@@ -1,6 -1,6 +1,6 @@@
- --- config-2_1.yml 2022-10-15 14:49:08.115591764 +0100
- +++ config-2_1.yml.MIDRES 2022-10-15 14:50:05.881594331 +0100
- @@ -127,45 +127,65 @@
---- config-2_1.yml 2022-10-15 16:29:48.670020291 +0100
-+++ config-2_1.yml.MIDRES 2022-10-15 16:30:17.879007207 +0100
-@@ -119,45 +119,65 @@
++--- config-2_1.yml 2022-10-27 10:16:44.059665934 +0100
+++++ config-2_1.yml.MIDRES 2022-10-27 10:18:01.949746099 +0100
++@@ -126,45 +126,65 @@
executor:
name: java8-executor
#exec_resource_class: xlarge
@@@ -73,8 -73,8 +73,8 @@@
separate_jobs: &separate_jobs
jobs:
- @@ -500,7 +520,7 @@
-@@ -459,7 +479,7 @@
- target: testclasslist-compression
++@@ -531,7 +551,7 @@
+ target: stress-test
j8_dtests_vnode:
- <<: *j8_par_executor
@@@ -82,7 -82,7 +82,7 @@@
steps:
- attach_workspace:
at: /home/cassandra
- @@ -514,7 +534,7 @@
-@@ -473,7 +493,7 @@
++@@ -545,7 +565,7 @@
pytest_extra_args: '--use-vnodes --num-tokens=32 --skip-resource-intensive-tests'
j8_dtests:
@@@ -91,7 -91,7 +91,7 @@@
steps:
- attach_workspace:
at: /home/cassandra
- @@ -528,7 +548,7 @@
-@@ -487,7 +507,7 @@
++@@ -559,7 +579,7 @@
pytest_extra_args: '--skip-resource-intensive-tests'
j8_upgrade_dtests:
diff --cc .circleci/config.yml
index ed0689d749,84da5cfb0a..aa877ba101
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@@ -183,6 -181,13 +183,15 @@@ jobs
tests=$(echo ${REPEATED_UTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=test-compression
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -201,9 -206,8 +210,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -288,183 -292,6 +296,191 @@@
- REPEATED_UTESTS_COUNT: 500
- REPEATED_UTESTS_LONG: null
- REPEATED_UTESTS_LONG_COUNT: 100
+ - REPEATED_UTESTS_STRESS: null
+ - REPEATED_UTESTS_STRESS_COUNT: 500
+ - REPEATED_JVM_DTESTS: null
+ - REPEATED_JVM_DTESTS_COUNT: 500
+ - REPEATED_JVM_UPGRADE_DTESTS: null
+ - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500
+ - REPEATED_DTESTS: null
+ - REPEATED_DTESTS_COUNT: 500
+ - REPEATED_UPGRADE_DTESTS: null
+ - REPEATED_UPGRADE_DTESTS_COUNT: 25
+ - REPEATED_ANT_TEST_TARGET: testsome
+ - REPEATED_ANT_TEST_CLASS: null
+ - REPEATED_ANT_TEST_METHODS: null
+ - REPEATED_ANT_TEST_COUNT: 500
+ - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ utests_stress_repeat:
+ docker:
+ - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
+ resource_class: medium
+ working_directory: ~/
+ shell: /bin/bash -eo pipefail -l
+ parallelism: 4
+ steps:
+ - attach_workspace:
+ at: /home/cassandra
+ - run:
+ name: Log Environment Information
+ command: |
+ echo '*** id ***'
+ id
+ echo '*** cat /proc/cpuinfo ***'
+ cat /proc/cpuinfo
+ echo '*** free -m ***'
+ free -m
+ echo '*** df -m ***'
+ df -m
+ echo '*** ifconfig -a ***'
+ ifconfig -a
+ echo '*** uname -a ***'
+ uname -a
+ echo '*** mount ***'
+ mount
+ echo '*** env ***'
+ env
+ echo '*** java ***'
+ which java
+ java -version
+ - run:
+ name: Repeatedly run new or modifed JUnit tests
+ no_output_timeout: 15m
+ command: |
+ set -x
+ export PATH=$JAVA_HOME/bin:$PATH
+ time mv ~/cassandra /tmp
+ cd /tmp/cassandra
+ if [ -d ~/dtest_jars ]; then
+ cp ~/dtest_jars/dtest* /tmp/cassandra/build/
+ fi
+
+ # Calculate the number of test iterations to be run by the current parallel runner.
+ count=$((${REPEATED_UTESTS_STRESS_COUNT} / CIRCLE_NODE_TOTAL))
+ if (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_STRESS_COUNT} % CIRCLE_NODE_TOTAL))); then
+ count=$((count+1))
+ fi
+
+ # Put manually specified tests and automatically detected tests together, removing duplicates
+ tests=$(echo ${REPEATED_UTESTS_STRESS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
+ echo "Tests to be repeated: ${tests}"
+
++ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
++ target=stress-test-some
++ testtag=""
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
++ testtag="compression"
++ fi
++
+ # Run each test class as many times as requested.
+ exit_code="$?"
+ for test in $tests; do
+
+ # Split class and method names from the test name
+ if [[ $test =~ "#" ]]; then
+ class=${test%"#"*}
+ method=${test#*"#"}
+ else
+ class=$test
+ method=""
+ fi
+
+ # Prepare the -Dtest.name argument.
+ # It can be the fully qualified class name or the short class name, depending on the target.
+ if [[ $target == "test" || \
+ $target == "test-cdc" || \
+ $target == "test-compression" || \
- $target == "test-system-keyspace-directory" || \
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
+ name_arg="-Dtest.name=${class##*.}"
+ else
+ name_arg="-Dtest.name=$class"
+ fi
+
+ # Prepare the -Dtest.methods argument, which is optional
- if [ $method == "" ]; then
++ if [[ $method == "" ]]; then
+ methods_arg=""
+ else
+ methods_arg="-Dtest.methods=$method"
+ fi
+
+ for i in $(seq -w 1 $count); do
+ echo "Running test $test, iteration $i of $count"
+
+ # run the test
+ status="passes"
+ if !( set -o pipefail && \
+ ant stress-test-some $name_arg $methods_arg -Dno-build-test=true | \
+ tee stdout.txt \
+ ); then
+ status="fails"
+ exit_code=1
+ fi
+
+ # move the stdout output file
+ dest=/tmp/results/repeated_utests/stdout/${status}/${i}
+ mkdir -p $dest
+ mv stdout.txt $dest/${test}.txt
+
+ # move the XML output files
- source=build/test/output
++ source=build/test/output/${testtag}
+ dest=/tmp/results/repeated_utests/output/${status}/${i}
+ mkdir -p $dest
+ if [[ -d $source && -n "$(ls $source)" ]]; then
+ mv $source/* $dest/
+ fi
+
+ # move the log files
- source=build/test/logs
++ source=build/test/logs/${testtag}
+ dest=/tmp/results/repeated_utests/logs/${status}/${i}
+ mkdir -p $dest
+ if [[ -d $source && -n "$(ls $source)" ]]; then
+ mv $source/* $dest/
+ fi
+
+ # maybe stop iterations on test failure
+ if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then
+ break
+ fi
+ done
+ done
+ (exit ${exit_code})
+ - store_test_results:
+ path: /tmp/results/repeated_utests/output
+ - store_artifacts:
+ path: /tmp/results/repeated_utests/stdout
+ destination: stdout
+ - store_artifacts:
+ path: /tmp/results/repeated_utests/output
+ destination: junitxml
+ - store_artifacts:
+ path: /tmp/results/repeated_utests/logs
+ destination: logs
+ environment:
+ - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - ANT_HOME: /usr/share/ant
+ - LANG: en_US.UTF-8
+ - KEEP_TEST_DIR: true
+ - DEFAULT_DIR: /home/cassandra/cassandra-dtest
+ - PYTHONIOENCODING: utf-8
+ - PYTHONUNBUFFERED: true
+ - CASS_DRIVER_NO_EXTENSIONS: true
+ - CASS_DRIVER_NO_CYTHON: true
+ - CASSANDRA_SKIP_SYNC: true
+ - DTEST_REPO: https://github.com/apache/cassandra-dtest.git
+ - DTEST_BRANCH: trunk
+ - CCM_MAX_HEAP_SIZE: 1024M
+ - CCM_HEAP_NEWSIZE: 256M
+ - REPEATED_TESTS_STOP_ON_FAILURE: false
+ - REPEATED_UTESTS: null
+ - REPEATED_UTESTS_COUNT: 500
+ - REPEATED_UTESTS_LONG: null
+ - REPEATED_UTESTS_LONG_COUNT: 100
+ - REPEATED_UTESTS_STRESS: null
+ - REPEATED_UTESTS_STRESS_COUNT: 500
- REPEATED_JVM_DTESTS: null
- REPEATED_JVM_DTESTS_COUNT: 500
- REPEATED_JVM_UPGRADE_DTESTS: null
@@@ -533,6 -360,13 +549,15 @@@
tests=$(echo ${REPEATED_UTESTS_LONG} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=long-testsome
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -551,9 -385,8 +576,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -708,6 -539,13 +732,15 @@@
tests=$(echo ${REPEATED_UTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=testsome
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -726,9 -564,8 +759,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -1351,6 -1178,13 +1383,15 @@@
tests=$(echo ${REPEATED_JVM_UPGRADE_DTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=test-jvm-dtest-some
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -1369,9 -1203,8 +1410,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -1428,78 -1261,13 +1468,189 @@@
- store_test_results:
path: /tmp/results/repeated_utests/output
- store_artifacts:
- path: /tmp/results/repeated_utests/stdout
- destination: stdout
+ path: /tmp/results/repeated_utests/stdout
+ destination: stdout
+ - store_artifacts:
+ path: /tmp/results/repeated_utests/output
+ destination: junitxml
+ - store_artifacts:
+ path: /tmp/results/repeated_utests/logs
+ destination: logs
+ environment:
+ - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - ANT_HOME: /usr/share/ant
+ - LANG: en_US.UTF-8
+ - KEEP_TEST_DIR: true
+ - DEFAULT_DIR: /home/cassandra/cassandra-dtest
+ - PYTHONIOENCODING: utf-8
+ - PYTHONUNBUFFERED: true
+ - CASS_DRIVER_NO_EXTENSIONS: true
+ - CASS_DRIVER_NO_CYTHON: true
+ - CASSANDRA_SKIP_SYNC: true
+ - DTEST_REPO: https://github.com/apache/cassandra-dtest.git
+ - DTEST_BRANCH: trunk
+ - CCM_MAX_HEAP_SIZE: 1024M
+ - CCM_HEAP_NEWSIZE: 256M
+ - REPEATED_TESTS_STOP_ON_FAILURE: false
+ - REPEATED_UTESTS: null
+ - REPEATED_UTESTS_COUNT: 500
+ - REPEATED_UTESTS_LONG: null
+ - REPEATED_UTESTS_LONG_COUNT: 100
+ - REPEATED_UTESTS_STRESS: null
+ - REPEATED_UTESTS_STRESS_COUNT: 500
+ - REPEATED_JVM_DTESTS: null
+ - REPEATED_JVM_DTESTS_COUNT: 500
+ - REPEATED_JVM_UPGRADE_DTESTS: null
+ - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500
+ - REPEATED_DTESTS: null
+ - REPEATED_DTESTS_COUNT: 500
+ - REPEATED_UPGRADE_DTESTS: null
+ - REPEATED_UPGRADE_DTESTS_COUNT: 25
+ - REPEATED_ANT_TEST_TARGET: testsome
+ - REPEATED_ANT_TEST_CLASS: null
+ - REPEATED_ANT_TEST_METHODS: null
+ - REPEATED_ANT_TEST_COUNT: 500
+ - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
++ utests_cdc:
++ docker:
++ - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
++ resource_class: medium
++ working_directory: ~/
++ shell: /bin/bash -eo pipefail -l
++ parallelism: 4
++ steps:
++ - attach_workspace:
++ at: /home/cassandra
++ - run:
++ name: Determine unit Tests to Run
++ command: |
++ # reminder: this code (along with all the steps) is independently executed on every circle container
++ # so the goal here is to get the circleci script to return the tests *this* container will run
++ # which we do via the `circleci` cli tool.
++
++ rm -fr ~/cassandra-dtest/upgrade_tests
++ echo "***java tests***"
++
++ # get all of our unit test filenames
++ set -eo pipefail && circleci tests glob "$HOME/cassandra/test/unit/**/*.java" > /tmp/all_java_unit_tests.txt
++
++ # split up the unit tests into groups based on the number of containers we have
++ set -eo pipefail && circleci tests split --split-by=timings --timings-type=filename --index=${CIRCLE_NODE_INDEX} --total=${CIRCLE_NODE_TOTAL} /tmp/all_java_unit_tests.txt > /tmp/java_tests_${CIRCLE_NODE_INDEX}.txt
++ set -eo pipefail && cat /tmp/java_tests_${CIRCLE_NODE_INDEX}.txt | sed "s;^/home/cassandra/cassandra/test/unit/;;g" | grep "Test\.java$" > /tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt
++ echo "** /tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt"
++ cat /tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt
++ no_output_timeout: 15m
++ - run:
++ name: Log Environment Information
++ command: |
++ echo '*** id ***'
++ id
++ echo '*** cat /proc/cpuinfo ***'
++ cat /proc/cpuinfo
++ echo '*** free -m ***'
++ free -m
++ echo '*** df -m ***'
++ df -m
++ echo '*** ifconfig -a ***'
++ ifconfig -a
++ echo '*** uname -a ***'
++ uname -a
++ echo '*** mount ***'
++ mount
++ echo '*** env ***'
++ env
++ echo '*** java ***'
++ which java
++ java -version
++ - run:
++ name: Run Unit Tests (testclasslist-cdc)
++ command: |
++ set -x
++ export PATH=$JAVA_HOME/bin:$PATH
++ time mv ~/cassandra /tmp
++ cd /tmp/cassandra
++ if [ -d ~/dtest_jars ]; then
++ cp ~/dtest_jars/dtest* /tmp/cassandra/build/
++ fi
++ test_timeout=$(grep 'name="test.unit.timeout"' build.xml | awk -F'"' '{print $4}' || true)
++ if [ -z "$test_timeout" ]; then
++ test_timeout=$(grep 'name="test.timeout"' build.xml | awk -F'"' '{print $4}')
++ fi
++ ant testclasslist-cdc -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit
++ no_output_timeout: 15m
++ - store_test_results:
++ path: /tmp/cassandra/build/test/output/
++ - store_artifacts:
++ path: /tmp/cassandra/build/test/output
++ destination: junitxml
++ - store_artifacts:
++ path: /tmp/cassandra/build/test/logs
++ destination: logs
++ environment:
++ - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64
++ - ANT_HOME: /usr/share/ant
++ - LANG: en_US.UTF-8
++ - KEEP_TEST_DIR: true
++ - DEFAULT_DIR: /home/cassandra/cassandra-dtest
++ - PYTHONIOENCODING: utf-8
++ - PYTHONUNBUFFERED: true
++ - CASS_DRIVER_NO_EXTENSIONS: true
++ - CASS_DRIVER_NO_CYTHON: true
++ - CASSANDRA_SKIP_SYNC: true
++ - DTEST_REPO: https://github.com/apache/cassandra-dtest.git
++ - DTEST_BRANCH: trunk
++ - CCM_MAX_HEAP_SIZE: 1024M
++ - CCM_HEAP_NEWSIZE: 256M
++ - REPEATED_TESTS_STOP_ON_FAILURE: false
++ - REPEATED_UTESTS: null
++ - REPEATED_UTESTS_COUNT: 500
++ - REPEATED_UTESTS_LONG: null
++ - REPEATED_UTESTS_LONG_COUNT: 100
++ - REPEATED_UTESTS_STRESS: null
++ - REPEATED_UTESTS_STRESS_COUNT: 500
++ - REPEATED_JVM_DTESTS: null
++ - REPEATED_JVM_DTESTS_COUNT: 500
++ - REPEATED_JVM_UPGRADE_DTESTS: null
++ - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500
++ - REPEATED_DTESTS: null
++ - REPEATED_DTESTS_COUNT: 500
++ - REPEATED_UPGRADE_DTESTS: null
++ - REPEATED_UPGRADE_DTESTS_COUNT: 25
++ - REPEATED_ANT_TEST_TARGET: testsome
++ - REPEATED_ANT_TEST_CLASS: null
++ - REPEATED_ANT_TEST_METHODS: null
++ - REPEATED_ANT_TEST_COUNT: 500
++ - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
++ - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ utests_stress:
+ docker:
+ - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
+ resource_class: medium
+ working_directory: ~/
+ shell: /bin/bash -eo pipefail -l
+ parallelism: 1
+ steps:
+ - attach_workspace:
+ at: /home/cassandra
+ - run:
+ name: Run Unit Tests (stress-test)
+ command: |
+ export PATH=$JAVA_HOME/bin:$PATH
+ time mv ~/cassandra /tmp
+ cd /tmp/cassandra
+ if [ -d ~/dtest_jars ]; then
+ cp ~/dtest_jars/dtest* /tmp/cassandra/build/
+ fi
+ ant stress-test -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit
+ no_output_timeout: 15m
+ - store_test_results:
+ path: /tmp/cassandra/build/test/output/
- store_artifacts:
- path: /tmp/results/repeated_utests/output
+ path: /tmp/cassandra/build/test/output
destination: junitxml
- store_artifacts:
- path: /tmp/results/repeated_utests/logs
+ path: /tmp/cassandra/build/test/logs
destination: logs
environment:
- JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64
@@@ -1856,6 -1616,13 +2007,15 @@@
tests=$(echo ${REPEATED_JVM_DTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=test-jvm-dtest-some
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -1874,9 -1641,8 +2034,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -2050,9 -1814,8 +2209,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name="-Dtest.name=$class_name"
else
name="-Dtest.name=$class_path"
@@@ -2265,22 -2026,20 +2423,205 @@@
- REPEATED_UTESTS_COUNT: 500
- REPEATED_UTESTS_LONG: null
- REPEATED_UTESTS_LONG_COUNT: 100
+ - REPEATED_UTESTS_STRESS: null
+ - REPEATED_UTESTS_STRESS_COUNT: 500
+ - REPEATED_JVM_DTESTS: null
+ - REPEATED_JVM_DTESTS_COUNT: 500
+ - REPEATED_JVM_UPGRADE_DTESTS: null
+ - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500
+ - REPEATED_DTESTS: null
+ - REPEATED_DTESTS_COUNT: 500
+ - REPEATED_UPGRADE_DTESTS: null
+ - REPEATED_UPGRADE_DTESTS_COUNT: 25
+ - REPEATED_ANT_TEST_TARGET: testsome
+ - REPEATED_ANT_TEST_CLASS: null
+ - REPEATED_ANT_TEST_METHODS: null
+ - REPEATED_ANT_TEST_COUNT: 500
+ - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
++ utests_cdc_repeat:
++ docker:
++ - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
++ resource_class: medium
++ working_directory: ~/
++ shell: /bin/bash -eo pipefail -l
++ parallelism: 4
++ steps:
++ - attach_workspace:
++ at: /home/cassandra
++ - run:
++ name: Log Environment Information
++ command: |
++ echo '*** id ***'
++ id
++ echo '*** cat /proc/cpuinfo ***'
++ cat /proc/cpuinfo
++ echo '*** free -m ***'
++ free -m
++ echo '*** df -m ***'
++ df -m
++ echo '*** ifconfig -a ***'
++ ifconfig -a
++ echo '*** uname -a ***'
++ uname -a
++ echo '*** mount ***'
++ mount
++ echo '*** env ***'
++ env
++ echo '*** java ***'
++ which java
++ java -version
++ - run:
++ name: Repeatedly run new or modifed JUnit tests
++ no_output_timeout: 15m
++ command: |
++ set -x
++ export PATH=$JAVA_HOME/bin:$PATH
++ time mv ~/cassandra /tmp
++ cd /tmp/cassandra
++ if [ -d ~/dtest_jars ]; then
++ cp ~/dtest_jars/dtest* /tmp/cassandra/build/
++ fi
++
++ # Calculate the number of test iterations to be run by the current parallel runner.
++ count=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))
++ if (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then
++ count=$((count+1))
++ fi
++
++ # Put manually specified tests and automatically detected tests together, removing duplicates
++ tests=$(echo ${REPEATED_UTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
++ echo "Tests to be repeated: ${tests}"
++
++ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
++ target=test-cdc
++ testtag=""
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
++ testtag="compression"
++ fi
++
++ # Run each test class as many times as requested.
++ exit_code="$?"
++ for test in $tests; do
++
++ # Split class and method names from the test name
++ if [[ $test =~ "#" ]]; then
++ class=${test%"#"*}
++ method=${test#*"#"}
++ else
++ class=$test
++ method=""
++ fi
++
++ # Prepare the -Dtest.name argument.
++ # It can be the fully qualified class name or the short class name, depending on the target.
++ if [[ $target == "test" || \
++ $target == "test-cdc" || \
++ $target == "test-compression" || \
++ $target == "long-test" || \
++ $target == "stress-test" ]]; then
++ name_arg="-Dtest.name=${class##*.}"
++ else
++ name_arg="-Dtest.name=$class"
++ fi
++
++ # Prepare the -Dtest.methods argument, which is optional
++ if [[ $method == "" ]]; then
++ methods_arg=""
++ else
++ methods_arg="-Dtest.methods=$method"
++ fi
++
++ for i in $(seq -w 1 $count); do
++ echo "Running test $test, iteration $i of $count"
++
++ # run the test
++ status="passes"
++ if !( set -o pipefail && \
++ ant test-cdc $name_arg $methods_arg -Dno-build-test=true | \
++ tee stdout.txt \
++ ); then
++ status="fails"
++ exit_code=1
++ fi
++
++ # move the stdout output file
++ dest=/tmp/results/repeated_utests/stdout/${status}/${i}
++ mkdir -p $dest
++ mv stdout.txt $dest/${test}.txt
++
++ # move the XML output files
++ source=build/test/output/${testtag}
++ dest=/tmp/results/repeated_utests/output/${status}/${i}
++ mkdir -p $dest
++ if [[ -d $source && -n "$(ls $source)" ]]; then
++ mv $source/* $dest/
++ fi
++
++ # move the log files
++ source=build/test/logs/${testtag}
++ dest=/tmp/results/repeated_utests/logs/${status}/${i}
++ mkdir -p $dest
++ if [[ -d $source && -n "$(ls $source)" ]]; then
++ mv $source/* $dest/
++ fi
++
++ # maybe stop iterations on test failure
++ if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then
++ break
++ fi
++ done
++ done
++ (exit ${exit_code})
++ - store_test_results:
++ path: /tmp/results/repeated_utests/output
++ - store_artifacts:
++ path: /tmp/results/repeated_utests/stdout
++ destination: stdout
++ - store_artifacts:
++ path: /tmp/results/repeated_utests/output
++ destination: junitxml
++ - store_artifacts:
++ path: /tmp/results/repeated_utests/logs
++ destination: logs
++ environment:
++ - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64
++ - ANT_HOME: /usr/share/ant
++ - LANG: en_US.UTF-8
++ - KEEP_TEST_DIR: true
++ - DEFAULT_DIR: /home/cassandra/cassandra-dtest
++ - PYTHONIOENCODING: utf-8
++ - PYTHONUNBUFFERED: true
++ - CASS_DRIVER_NO_EXTENSIONS: true
++ - CASS_DRIVER_NO_CYTHON: true
++ - CASSANDRA_SKIP_SYNC: true
++ - DTEST_REPO: https://github.com/apache/cassandra-dtest.git
++ - DTEST_BRANCH: trunk
++ - CCM_MAX_HEAP_SIZE: 1024M
++ - CCM_HEAP_NEWSIZE: 256M
++ - REPEATED_TESTS_STOP_ON_FAILURE: false
++ - REPEATED_UTESTS: null
++ - REPEATED_UTESTS_COUNT: 500
++ - REPEATED_UTESTS_LONG: null
++ - REPEATED_UTESTS_LONG_COUNT: 100
++ - REPEATED_UTESTS_STRESS: null
++ - REPEATED_UTESTS_STRESS_COUNT: 500
+ - REPEATED_JVM_DTESTS: null
+ - REPEATED_JVM_DTESTS_COUNT: 500
+ - REPEATED_JVM_UPGRADE_DTESTS: null
+ - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500
+ - REPEATED_DTESTS: null
+ - REPEATED_DTESTS_COUNT: 500
+ - REPEATED_UPGRADE_DTESTS: null
+ - REPEATED_UPGRADE_DTESTS_COUNT: 25
+ - REPEATED_ANT_TEST_TARGET: testsome
+ - REPEATED_ANT_TEST_CLASS: null
+ - REPEATED_ANT_TEST_METHODS: null
+ - REPEATED_ANT_TEST_COUNT: 500
+ - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
j8_jvm_dtests:
docker:
- image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
@@@ -2692,6 -2443,6 +3033,12 @@@ workflows
requires:
- start_utests_long
- build
++ - start_utests_cdc:
++ type: approval
++ - utests_cdc:
++ requires:
++ - start_utests_cdc
++ - build
- start_utests_compression:
type: approval
- utests_compression:
@@@ -2753,6 -2498,6 +3100,12 @@@
requires:
- start_utests_long
- build
++ - start_utests_cdc:
++ type: approval
++ - utests_cdc:
++ requires:
++ - start_utests_cdc
++ - build
- start_utests_compression:
type: approval
- utests_compression:
diff --cc .circleci/config.yml.HIGHRES
index b832815cc3,cf4e5f4fcb..d35a97ece5
--- a/.circleci/config.yml.HIGHRES
+++ b/.circleci/config.yml.HIGHRES
@@@ -183,6 -181,13 +183,15 @@@ jobs
tests=$(echo ${REPEATED_UTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=test-compression
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -201,9 -206,8 +210,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -288,183 -292,6 +296,191 @@@
- REPEATED_UTESTS_COUNT: 500
- REPEATED_UTESTS_LONG: null
- REPEATED_UTESTS_LONG_COUNT: 100
+ - REPEATED_UTESTS_STRESS: null
+ - REPEATED_UTESTS_STRESS_COUNT: 500
+ - REPEATED_JVM_DTESTS: null
+ - REPEATED_JVM_DTESTS_COUNT: 500
+ - REPEATED_JVM_UPGRADE_DTESTS: null
+ - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500
+ - REPEATED_DTESTS: null
+ - REPEATED_DTESTS_COUNT: 500
+ - REPEATED_UPGRADE_DTESTS: null
+ - REPEATED_UPGRADE_DTESTS_COUNT: 25
+ - REPEATED_ANT_TEST_TARGET: testsome
+ - REPEATED_ANT_TEST_CLASS: null
+ - REPEATED_ANT_TEST_METHODS: null
+ - REPEATED_ANT_TEST_COUNT: 500
+ - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ utests_stress_repeat:
+ docker:
+ - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
+ resource_class: xlarge
+ working_directory: ~/
+ shell: /bin/bash -eo pipefail -l
+ parallelism: 100
+ steps:
+ - attach_workspace:
+ at: /home/cassandra
+ - run:
+ name: Log Environment Information
+ command: |
+ echo '*** id ***'
+ id
+ echo '*** cat /proc/cpuinfo ***'
+ cat /proc/cpuinfo
+ echo '*** free -m ***'
+ free -m
+ echo '*** df -m ***'
+ df -m
+ echo '*** ifconfig -a ***'
+ ifconfig -a
+ echo '*** uname -a ***'
+ uname -a
+ echo '*** mount ***'
+ mount
+ echo '*** env ***'
+ env
+ echo '*** java ***'
+ which java
+ java -version
+ - run:
+ name: Repeatedly run new or modifed JUnit tests
+ no_output_timeout: 15m
+ command: |
+ set -x
+ export PATH=$JAVA_HOME/bin:$PATH
+ time mv ~/cassandra /tmp
+ cd /tmp/cassandra
+ if [ -d ~/dtest_jars ]; then
+ cp ~/dtest_jars/dtest* /tmp/cassandra/build/
+ fi
+
+ # Calculate the number of test iterations to be run by the current parallel runner.
+ count=$((${REPEATED_UTESTS_STRESS_COUNT} / CIRCLE_NODE_TOTAL))
+ if (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_STRESS_COUNT} % CIRCLE_NODE_TOTAL))); then
+ count=$((count+1))
+ fi
+
+ # Put manually specified tests and automatically detected tests together, removing duplicates
+ tests=$(echo ${REPEATED_UTESTS_STRESS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
+ echo "Tests to be repeated: ${tests}"
+
++ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
++ target=stress-test-some
++ testtag=""
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
++ testtag="compression"
++ fi
++
+ # Run each test class as many times as requested.
+ exit_code="$?"
+ for test in $tests; do
+
+ # Split class and method names from the test name
+ if [[ $test =~ "#" ]]; then
+ class=${test%"#"*}
+ method=${test#*"#"}
+ else
+ class=$test
+ method=""
+ fi
+
+ # Prepare the -Dtest.name argument.
+ # It can be the fully qualified class name or the short class name, depending on the target.
+ if [[ $target == "test" || \
+ $target == "test-cdc" || \
+ $target == "test-compression" || \
- $target == "test-system-keyspace-directory" || \
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
+ name_arg="-Dtest.name=${class##*.}"
+ else
+ name_arg="-Dtest.name=$class"
+ fi
+
+ # Prepare the -Dtest.methods argument, which is optional
- if [ $method == "" ]; then
++ if [[ $method == "" ]]; then
+ methods_arg=""
+ else
+ methods_arg="-Dtest.methods=$method"
+ fi
+
+ for i in $(seq -w 1 $count); do
+ echo "Running test $test, iteration $i of $count"
+
+ # run the test
+ status="passes"
+ if !( set -o pipefail && \
+ ant stress-test-some $name_arg $methods_arg -Dno-build-test=true | \
+ tee stdout.txt \
+ ); then
+ status="fails"
+ exit_code=1
+ fi
+
+ # move the stdout output file
+ dest=/tmp/results/repeated_utests/stdout/${status}/${i}
+ mkdir -p $dest
+ mv stdout.txt $dest/${test}.txt
+
+ # move the XML output files
- source=build/test/output
++ source=build/test/output/${testtag}
+ dest=/tmp/results/repeated_utests/output/${status}/${i}
+ mkdir -p $dest
+ if [[ -d $source && -n "$(ls $source)" ]]; then
+ mv $source/* $dest/
+ fi
+
+ # move the log files
- source=build/test/logs
++ source=build/test/logs/${testtag}
+ dest=/tmp/results/repeated_utests/logs/${status}/${i}
+ mkdir -p $dest
+ if [[ -d $source && -n "$(ls $source)" ]]; then
+ mv $source/* $dest/
+ fi
+
+ # maybe stop iterations on test failure
+ if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then
+ break
+ fi
+ done
+ done
+ (exit ${exit_code})
+ - store_test_results:
+ path: /tmp/results/repeated_utests/output
+ - store_artifacts:
+ path: /tmp/results/repeated_utests/stdout
+ destination: stdout
+ - store_artifacts:
+ path: /tmp/results/repeated_utests/output
+ destination: junitxml
+ - store_artifacts:
+ path: /tmp/results/repeated_utests/logs
+ destination: logs
+ environment:
+ - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - ANT_HOME: /usr/share/ant
+ - LANG: en_US.UTF-8
+ - KEEP_TEST_DIR: true
+ - DEFAULT_DIR: /home/cassandra/cassandra-dtest
+ - PYTHONIOENCODING: utf-8
+ - PYTHONUNBUFFERED: true
+ - CASS_DRIVER_NO_EXTENSIONS: true
+ - CASS_DRIVER_NO_CYTHON: true
+ - CASSANDRA_SKIP_SYNC: true
+ - DTEST_REPO: https://github.com/apache/cassandra-dtest.git
+ - DTEST_BRANCH: trunk
+ - CCM_MAX_HEAP_SIZE: 2048M
+ - CCM_HEAP_NEWSIZE: 512M
+ - REPEATED_TESTS_STOP_ON_FAILURE: false
+ - REPEATED_UTESTS: null
+ - REPEATED_UTESTS_COUNT: 500
+ - REPEATED_UTESTS_LONG: null
+ - REPEATED_UTESTS_LONG_COUNT: 100
+ - REPEATED_UTESTS_STRESS: null
+ - REPEATED_UTESTS_STRESS_COUNT: 500
- REPEATED_JVM_DTESTS: null
- REPEATED_JVM_DTESTS_COUNT: 500
- REPEATED_JVM_UPGRADE_DTESTS: null
@@@ -533,6 -360,13 +549,15 @@@
tests=$(echo ${REPEATED_UTESTS_LONG} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=long-testsome
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -551,9 -385,8 +576,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -708,6 -539,13 +732,15 @@@
tests=$(echo ${REPEATED_UTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=testsome
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -726,9 -564,8 +759,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -1351,6 -1178,13 +1383,15 @@@
tests=$(echo ${REPEATED_JVM_UPGRADE_DTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=test-jvm-dtest-some
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -1369,9 -1203,8 +1410,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -1472,7 -1303,116 +1512,118 @@@
- REPEATED_ANT_TEST_COUNT: 500
- JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
- JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
- j8_unit_tests:
++ utests_cdc:
+ docker:
+ - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
+ resource_class: xlarge
+ working_directory: ~/
+ shell: /bin/bash -eo pipefail -l
+ parallelism: 100
+ steps:
+ - attach_workspace:
+ at: /home/cassandra
+ - run:
+ name: Determine unit Tests to Run
+ command: |
+ # reminder: this code (along with all the steps) is independently executed on every circle container
+ # so the goal here is to get the circleci script to return the tests *this* container will run
+ # which we do via the `circleci` cli tool.
+
+ rm -fr ~/cassandra-dtest/upgrade_tests
+ echo "***java tests***"
+
+ # get all of our unit test filenames
+ set -eo pipefail && circleci tests glob "$HOME/cassandra/test/unit/**/*.java" > /tmp/all_java_unit_tests.txt
+
+ # split up the unit tests into groups based on the number of containers we have
+ set -eo pipefail && circleci tests split --split-by=timings --timings-type=filename --index=${CIRCLE_NODE_INDEX} --total=${CIRCLE_NODE_TOTAL} /tmp/all_java_unit_tests.txt > /tmp/java_tests_${CIRCLE_NODE_INDEX}.txt
+ set -eo pipefail && cat /tmp/java_tests_${CIRCLE_NODE_INDEX}.txt | sed "s;^/home/cassandra/cassandra/test/unit/;;g" | grep "Test\.java$" > /tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt
+ echo "** /tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt"
+ cat /tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt
+ no_output_timeout: 15m
+ - run:
+ name: Log Environment Information
+ command: |
+ echo '*** id ***'
+ id
+ echo '*** cat /proc/cpuinfo ***'
+ cat /proc/cpuinfo
+ echo '*** free -m ***'
+ free -m
+ echo '*** df -m ***'
+ df -m
+ echo '*** ifconfig -a ***'
+ ifconfig -a
+ echo '*** uname -a ***'
+ uname -a
+ echo '*** mount ***'
+ mount
+ echo '*** env ***'
+ env
+ echo '*** java ***'
+ which java
+ java -version
+ - run:
- name: Run Unit Tests (testclasslist)
++ name: Run Unit Tests (testclasslist-cdc)
+ command: |
+ set -x
+ export PATH=$JAVA_HOME/bin:$PATH
+ time mv ~/cassandra /tmp
+ cd /tmp/cassandra
+ if [ -d ~/dtest_jars ]; then
+ cp ~/dtest_jars/dtest* /tmp/cassandra/build/
+ fi
+ test_timeout=$(grep 'name="test.unit.timeout"' build.xml | awk -F'"' '{print $4}' || true)
+ if [ -z "$test_timeout" ]; then
+ test_timeout=$(grep 'name="test.timeout"' build.xml | awk -F'"' '{print $4}')
+ fi
- ant testclasslist -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit
++ ant testclasslist-cdc -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit
+ no_output_timeout: 15m
+ - store_test_results:
+ path: /tmp/cassandra/build/test/output/
+ - store_artifacts:
+ path: /tmp/cassandra/build/test/output
+ destination: junitxml
+ - store_artifacts:
+ path: /tmp/cassandra/build/test/logs
+ destination: logs
+ environment:
+ - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - ANT_HOME: /usr/share/ant
+ - LANG: en_US.UTF-8
+ - KEEP_TEST_DIR: true
+ - DEFAULT_DIR: /home/cassandra/cassandra-dtest
+ - PYTHONIOENCODING: utf-8
+ - PYTHONUNBUFFERED: true
+ - CASS_DRIVER_NO_EXTENSIONS: true
+ - CASS_DRIVER_NO_CYTHON: true
+ - CASSANDRA_SKIP_SYNC: true
+ - DTEST_REPO: https://github.com/apache/cassandra-dtest.git
+ - DTEST_BRANCH: trunk
+ - CCM_MAX_HEAP_SIZE: 2048M
+ - CCM_HEAP_NEWSIZE: 512M
+ - REPEATED_TESTS_STOP_ON_FAILURE: false
+ - REPEATED_UTESTS: null
+ - REPEATED_UTESTS_COUNT: 500
+ - REPEATED_UTESTS_LONG: null
+ - REPEATED_UTESTS_LONG_COUNT: 100
++ - REPEATED_UTESTS_STRESS: null
++ - REPEATED_UTESTS_STRESS_COUNT: 500
+ - REPEATED_JVM_DTESTS: null
+ - REPEATED_JVM_DTESTS_COUNT: 500
+ - REPEATED_JVM_UPGRADE_DTESTS: null
+ - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500
+ - REPEATED_DTESTS: null
+ - REPEATED_DTESTS_COUNT: 500
+ - REPEATED_UPGRADE_DTESTS: null
+ - REPEATED_UPGRADE_DTESTS_COUNT: 25
+ - REPEATED_ANT_TEST_TARGET: testsome
+ - REPEATED_ANT_TEST_CLASS: null
+ - REPEATED_ANT_TEST_METHODS: null
+ - REPEATED_ANT_TEST_COUNT: 500
+ - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
- j8_dtests:
+ utests_stress:
docker:
- image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
resource_class: xlarge
@@@ -1856,6 -1616,13 +2007,15 @@@
tests=$(echo ${REPEATED_JVM_DTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=test-jvm-dtest-some
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -1874,9 -1641,8 +2034,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -2050,9 -1814,8 +2209,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name="-Dtest.name=$class_name"
else
name="-Dtest.name=$class_path"
@@@ -2265,22 -2026,20 +2423,205 @@@
- REPEATED_UTESTS_COUNT: 500
- REPEATED_UTESTS_LONG: null
- REPEATED_UTESTS_LONG_COUNT: 100
+ - REPEATED_UTESTS_STRESS: null
+ - REPEATED_UTESTS_STRESS_COUNT: 500
+ - REPEATED_JVM_DTESTS: null
+ - REPEATED_JVM_DTESTS_COUNT: 500
+ - REPEATED_JVM_UPGRADE_DTESTS: null
+ - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500
+ - REPEATED_DTESTS: null
+ - REPEATED_DTESTS_COUNT: 500
+ - REPEATED_UPGRADE_DTESTS: null
+ - REPEATED_UPGRADE_DTESTS_COUNT: 25
+ - REPEATED_ANT_TEST_TARGET: testsome
+ - REPEATED_ANT_TEST_CLASS: null
+ - REPEATED_ANT_TEST_METHODS: null
+ - REPEATED_ANT_TEST_COUNT: 500
+ - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
++ utests_cdc_repeat:
++ docker:
++ - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
++ resource_class: xlarge
++ working_directory: ~/
++ shell: /bin/bash -eo pipefail -l
++ parallelism: 100
++ steps:
++ - attach_workspace:
++ at: /home/cassandra
++ - run:
++ name: Log Environment Information
++ command: |
++ echo '*** id ***'
++ id
++ echo '*** cat /proc/cpuinfo ***'
++ cat /proc/cpuinfo
++ echo '*** free -m ***'
++ free -m
++ echo '*** df -m ***'
++ df -m
++ echo '*** ifconfig -a ***'
++ ifconfig -a
++ echo '*** uname -a ***'
++ uname -a
++ echo '*** mount ***'
++ mount
++ echo '*** env ***'
++ env
++ echo '*** java ***'
++ which java
++ java -version
++ - run:
++ name: Repeatedly run new or modifed JUnit tests
++ no_output_timeout: 15m
++ command: |
++ set -x
++ export PATH=$JAVA_HOME/bin:$PATH
++ time mv ~/cassandra /tmp
++ cd /tmp/cassandra
++ if [ -d ~/dtest_jars ]; then
++ cp ~/dtest_jars/dtest* /tmp/cassandra/build/
++ fi
++
++ # Calculate the number of test iterations to be run by the current parallel runner.
++ count=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))
++ if (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then
++ count=$((count+1))
++ fi
++
++ # Put manually specified tests and automatically detected tests together, removing duplicates
++ tests=$(echo ${REPEATED_UTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
++ echo "Tests to be repeated: ${tests}"
++
++ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
++ target=test-cdc
++ testtag=""
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
++ testtag="compression"
++ fi
++
++ # Run each test class as many times as requested.
++ exit_code="$?"
++ for test in $tests; do
++
++ # Split class and method names from the test name
++ if [[ $test =~ "#" ]]; then
++ class=${test%"#"*}
++ method=${test#*"#"}
++ else
++ class=$test
++ method=""
++ fi
++
++ # Prepare the -Dtest.name argument.
++ # It can be the fully qualified class name or the short class name, depending on the target.
++ if [[ $target == "test" || \
++ $target == "test-cdc" || \
++ $target == "test-compression" || \
++ $target == "long-test" || \
++ $target == "stress-test" ]]; then
++ name_arg="-Dtest.name=${class##*.}"
++ else
++ name_arg="-Dtest.name=$class"
++ fi
++
++ # Prepare the -Dtest.methods argument, which is optional
++ if [[ $method == "" ]]; then
++ methods_arg=""
++ else
++ methods_arg="-Dtest.methods=$method"
++ fi
++
++ for i in $(seq -w 1 $count); do
++ echo "Running test $test, iteration $i of $count"
++
++ # run the test
++ status="passes"
++ if !( set -o pipefail && \
++ ant test-cdc $name_arg $methods_arg -Dno-build-test=true | \
++ tee stdout.txt \
++ ); then
++ status="fails"
++ exit_code=1
++ fi
++
++ # move the stdout output file
++ dest=/tmp/results/repeated_utests/stdout/${status}/${i}
++ mkdir -p $dest
++ mv stdout.txt $dest/${test}.txt
++
++ # move the XML output files
++ source=build/test/output/${testtag}
++ dest=/tmp/results/repeated_utests/output/${status}/${i}
++ mkdir -p $dest
++ if [[ -d $source && -n "$(ls $source)" ]]; then
++ mv $source/* $dest/
++ fi
++
++ # move the log files
++ source=build/test/logs/${testtag}
++ dest=/tmp/results/repeated_utests/logs/${status}/${i}
++ mkdir -p $dest
++ if [[ -d $source && -n "$(ls $source)" ]]; then
++ mv $source/* $dest/
++ fi
++
++ # maybe stop iterations on test failure
++ if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then
++ break
++ fi
++ done
++ done
++ (exit ${exit_code})
++ - store_test_results:
++ path: /tmp/results/repeated_utests/output
++ - store_artifacts:
++ path: /tmp/results/repeated_utests/stdout
++ destination: stdout
++ - store_artifacts:
++ path: /tmp/results/repeated_utests/output
++ destination: junitxml
++ - store_artifacts:
++ path: /tmp/results/repeated_utests/logs
++ destination: logs
++ environment:
++ - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64
++ - ANT_HOME: /usr/share/ant
++ - LANG: en_US.UTF-8
++ - KEEP_TEST_DIR: true
++ - DEFAULT_DIR: /home/cassandra/cassandra-dtest
++ - PYTHONIOENCODING: utf-8
++ - PYTHONUNBUFFERED: true
++ - CASS_DRIVER_NO_EXTENSIONS: true
++ - CASS_DRIVER_NO_CYTHON: true
++ - CASSANDRA_SKIP_SYNC: true
++ - DTEST_REPO: https://github.com/apache/cassandra-dtest.git
++ - DTEST_BRANCH: trunk
++ - CCM_MAX_HEAP_SIZE: 2048M
++ - CCM_HEAP_NEWSIZE: 512M
++ - REPEATED_TESTS_STOP_ON_FAILURE: false
++ - REPEATED_UTESTS: null
++ - REPEATED_UTESTS_COUNT: 500
++ - REPEATED_UTESTS_LONG: null
++ - REPEATED_UTESTS_LONG_COUNT: 100
++ - REPEATED_UTESTS_STRESS: null
++ - REPEATED_UTESTS_STRESS_COUNT: 500
+ - REPEATED_JVM_DTESTS: null
+ - REPEATED_JVM_DTESTS_COUNT: 500
+ - REPEATED_JVM_UPGRADE_DTESTS: null
+ - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500
+ - REPEATED_DTESTS: null
+ - REPEATED_DTESTS_COUNT: 500
+ - REPEATED_UPGRADE_DTESTS: null
+ - REPEATED_UPGRADE_DTESTS_COUNT: 25
+ - REPEATED_ANT_TEST_TARGET: testsome
+ - REPEATED_ANT_TEST_CLASS: null
+ - REPEATED_ANT_TEST_METHODS: null
+ - REPEATED_ANT_TEST_COUNT: 500
+ - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
j8_jvm_dtests:
docker:
- image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
@@@ -2710,6 -2461,6 +3051,18 @@@ workflows
requires:
- start_utests_long_repeat
- build
++ - start_utests_cdc:
++ type: approval
++ - utests_cdc:
++ requires:
++ - start_utests_cdc
++ - build
++ - start_utests_cdc_repeat:
++ type: approval
++ - utests_cdc_repeat:
++ requires:
++ - start_utests_cdc_repeat
++ - build
- start_utests_compression:
type: approval
- utests_compression:
@@@ -2823,6 -2562,6 +3176,16 @@@
requires:
- start_utests_long
- build
++ - start_utests_cdc:
++ type: approval
++ - utests_cdc:
++ requires:
++ - start_utests_cdc
++ - build
++ - utests_cdc_repeat:
++ requires:
++ - start_utests_cdc
++ - build
- start_utests_compression:
type: approval
- utests_compression:
diff --cc .circleci/config.yml.LOWRES
index fcebba8dae,f611444ec2..7358442b26
--- a/.circleci/config.yml.LOWRES
+++ b/.circleci/config.yml.LOWRES
@@@ -183,6 -181,13 +183,15 @@@ jobs
tests=$(echo ${REPEATED_UTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=test-compression
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -201,9 -206,8 +210,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -288,183 -292,6 +296,191 @@@
- REPEATED_UTESTS_COUNT: 500
- REPEATED_UTESTS_LONG: null
- REPEATED_UTESTS_LONG_COUNT: 100
+ - REPEATED_UTESTS_STRESS: null
+ - REPEATED_UTESTS_STRESS_COUNT: 500
+ - REPEATED_JVM_DTESTS: null
+ - REPEATED_JVM_DTESTS_COUNT: 500
+ - REPEATED_JVM_UPGRADE_DTESTS: null
+ - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500
+ - REPEATED_DTESTS: null
+ - REPEATED_DTESTS_COUNT: 500
+ - REPEATED_UPGRADE_DTESTS: null
+ - REPEATED_UPGRADE_DTESTS_COUNT: 25
+ - REPEATED_ANT_TEST_TARGET: testsome
+ - REPEATED_ANT_TEST_CLASS: null
+ - REPEATED_ANT_TEST_METHODS: null
+ - REPEATED_ANT_TEST_COUNT: 500
+ - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ utests_stress_repeat:
+ docker:
+ - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
+ resource_class: medium
+ working_directory: ~/
+ shell: /bin/bash -eo pipefail -l
+ parallelism: 4
+ steps:
+ - attach_workspace:
+ at: /home/cassandra
+ - run:
+ name: Log Environment Information
+ command: |
+ echo '*** id ***'
+ id
+ echo '*** cat /proc/cpuinfo ***'
+ cat /proc/cpuinfo
+ echo '*** free -m ***'
+ free -m
+ echo '*** df -m ***'
+ df -m
+ echo '*** ifconfig -a ***'
+ ifconfig -a
+ echo '*** uname -a ***'
+ uname -a
+ echo '*** mount ***'
+ mount
+ echo '*** env ***'
+ env
+ echo '*** java ***'
+ which java
+ java -version
+ - run:
+ name: Repeatedly run new or modifed JUnit tests
+ no_output_timeout: 15m
+ command: |
+ set -x
+ export PATH=$JAVA_HOME/bin:$PATH
+ time mv ~/cassandra /tmp
+ cd /tmp/cassandra
+ if [ -d ~/dtest_jars ]; then
+ cp ~/dtest_jars/dtest* /tmp/cassandra/build/
+ fi
+
+ # Calculate the number of test iterations to be run by the current parallel runner.
+ count=$((${REPEATED_UTESTS_STRESS_COUNT} / CIRCLE_NODE_TOTAL))
+ if (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_STRESS_COUNT} % CIRCLE_NODE_TOTAL))); then
+ count=$((count+1))
+ fi
+
+ # Put manually specified tests and automatically detected tests together, removing duplicates
+ tests=$(echo ${REPEATED_UTESTS_STRESS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
+ echo "Tests to be repeated: ${tests}"
+
++ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
++ target=stress-test-some
++ testtag=""
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
++ testtag="compression"
++ fi
++
+ # Run each test class as many times as requested.
+ exit_code="$?"
+ for test in $tests; do
+
+ # Split class and method names from the test name
+ if [[ $test =~ "#" ]]; then
+ class=${test%"#"*}
+ method=${test#*"#"}
+ else
+ class=$test
+ method=""
+ fi
+
+ # Prepare the -Dtest.name argument.
+ # It can be the fully qualified class name or the short class name, depending on the target.
+ if [[ $target == "test" || \
+ $target == "test-cdc" || \
+ $target == "test-compression" || \
- $target == "test-system-keyspace-directory" || \
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
+ name_arg="-Dtest.name=${class##*.}"
+ else
+ name_arg="-Dtest.name=$class"
+ fi
+
+ # Prepare the -Dtest.methods argument, which is optional
- if [ $method == "" ]; then
++ if [[ $method == "" ]]; then
+ methods_arg=""
+ else
+ methods_arg="-Dtest.methods=$method"
+ fi
+
+ for i in $(seq -w 1 $count); do
+ echo "Running test $test, iteration $i of $count"
+
+ # run the test
+ status="passes"
+ if !( set -o pipefail && \
+ ant stress-test-some $name_arg $methods_arg -Dno-build-test=true | \
+ tee stdout.txt \
+ ); then
+ status="fails"
+ exit_code=1
+ fi
+
+ # move the stdout output file
+ dest=/tmp/results/repeated_utests/stdout/${status}/${i}
+ mkdir -p $dest
+ mv stdout.txt $dest/${test}.txt
+
+ # move the XML output files
- source=build/test/output
++ source=build/test/output/${testtag}
+ dest=/tmp/results/repeated_utests/output/${status}/${i}
+ mkdir -p $dest
+ if [[ -d $source && -n "$(ls $source)" ]]; then
+ mv $source/* $dest/
+ fi
+
+ # move the log files
- source=build/test/logs
++ source=build/test/logs/${testtag}
+ dest=/tmp/results/repeated_utests/logs/${status}/${i}
+ mkdir -p $dest
+ if [[ -d $source && -n "$(ls $source)" ]]; then
+ mv $source/* $dest/
+ fi
+
+ # maybe stop iterations on test failure
+ if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then
+ break
+ fi
+ done
+ done
+ (exit ${exit_code})
+ - store_test_results:
+ path: /tmp/results/repeated_utests/output
+ - store_artifacts:
+ path: /tmp/results/repeated_utests/stdout
+ destination: stdout
+ - store_artifacts:
+ path: /tmp/results/repeated_utests/output
+ destination: junitxml
+ - store_artifacts:
+ path: /tmp/results/repeated_utests/logs
+ destination: logs
+ environment:
+ - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - ANT_HOME: /usr/share/ant
+ - LANG: en_US.UTF-8
+ - KEEP_TEST_DIR: true
+ - DEFAULT_DIR: /home/cassandra/cassandra-dtest
+ - PYTHONIOENCODING: utf-8
+ - PYTHONUNBUFFERED: true
+ - CASS_DRIVER_NO_EXTENSIONS: true
+ - CASS_DRIVER_NO_CYTHON: true
+ - CASSANDRA_SKIP_SYNC: true
+ - DTEST_REPO: https://github.com/apache/cassandra-dtest.git
+ - DTEST_BRANCH: trunk
+ - CCM_MAX_HEAP_SIZE: 1024M
+ - CCM_HEAP_NEWSIZE: 256M
+ - REPEATED_TESTS_STOP_ON_FAILURE: false
+ - REPEATED_UTESTS: null
+ - REPEATED_UTESTS_COUNT: 500
+ - REPEATED_UTESTS_LONG: null
+ - REPEATED_UTESTS_LONG_COUNT: 100
+ - REPEATED_UTESTS_STRESS: null
+ - REPEATED_UTESTS_STRESS_COUNT: 500
- REPEATED_JVM_DTESTS: null
- REPEATED_JVM_DTESTS_COUNT: 500
- REPEATED_JVM_UPGRADE_DTESTS: null
@@@ -533,6 -360,13 +549,15 @@@
tests=$(echo ${REPEATED_UTESTS_LONG} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=long-testsome
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -551,9 -385,8 +576,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -708,6 -539,13 +732,15 @@@
tests=$(echo ${REPEATED_UTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=testsome
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -726,9 -564,8 +759,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -1351,6 -1178,13 +1383,15 @@@
tests=$(echo ${REPEATED_JVM_UPGRADE_DTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=test-jvm-dtest-some
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -1369,9 -1203,8 +1410,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -1426,80 -1259,15 +1466,191 @@@
done
(exit ${exit_code})
- store_test_results:
- path: /tmp/results/repeated_utests/output
- - store_artifacts:
- path: /tmp/results/repeated_utests/stdout
- destination: stdout
+ path: /tmp/results/repeated_utests/output
+ - store_artifacts:
+ path: /tmp/results/repeated_utests/stdout
+ destination: stdout
+ - store_artifacts:
+ path: /tmp/results/repeated_utests/output
+ destination: junitxml
+ - store_artifacts:
+ path: /tmp/results/repeated_utests/logs
+ destination: logs
+ environment:
+ - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - ANT_HOME: /usr/share/ant
+ - LANG: en_US.UTF-8
+ - KEEP_TEST_DIR: true
+ - DEFAULT_DIR: /home/cassandra/cassandra-dtest
+ - PYTHONIOENCODING: utf-8
+ - PYTHONUNBUFFERED: true
+ - CASS_DRIVER_NO_EXTENSIONS: true
+ - CASS_DRIVER_NO_CYTHON: true
+ - CASSANDRA_SKIP_SYNC: true
+ - DTEST_REPO: https://github.com/apache/cassandra-dtest.git
+ - DTEST_BRANCH: trunk
+ - CCM_MAX_HEAP_SIZE: 1024M
+ - CCM_HEAP_NEWSIZE: 256M
+ - REPEATED_TESTS_STOP_ON_FAILURE: false
+ - REPEATED_UTESTS: null
+ - REPEATED_UTESTS_COUNT: 500
+ - REPEATED_UTESTS_LONG: null
+ - REPEATED_UTESTS_LONG_COUNT: 100
+ - REPEATED_UTESTS_STRESS: null
+ - REPEATED_UTESTS_STRESS_COUNT: 500
+ - REPEATED_JVM_DTESTS: null
+ - REPEATED_JVM_DTESTS_COUNT: 500
+ - REPEATED_JVM_UPGRADE_DTESTS: null
+ - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500
+ - REPEATED_DTESTS: null
+ - REPEATED_DTESTS_COUNT: 500
+ - REPEATED_UPGRADE_DTESTS: null
+ - REPEATED_UPGRADE_DTESTS_COUNT: 25
+ - REPEATED_ANT_TEST_TARGET: testsome
+ - REPEATED_ANT_TEST_CLASS: null
+ - REPEATED_ANT_TEST_METHODS: null
+ - REPEATED_ANT_TEST_COUNT: 500
+ - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
++ utests_cdc:
++ docker:
++ - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
++ resource_class: medium
++ working_directory: ~/
++ shell: /bin/bash -eo pipefail -l
++ parallelism: 4
++ steps:
++ - attach_workspace:
++ at: /home/cassandra
++ - run:
++ name: Determine unit Tests to Run
++ command: |
++ # reminder: this code (along with all the steps) is independently executed on every circle container
++ # so the goal here is to get the circleci script to return the tests *this* container will run
++ # which we do via the `circleci` cli tool.
++
++ rm -fr ~/cassandra-dtest/upgrade_tests
++ echo "***java tests***"
++
++ # get all of our unit test filenames
++ set -eo pipefail && circleci tests glob "$HOME/cassandra/test/unit/**/*.java" > /tmp/all_java_unit_tests.txt
++
++ # split up the unit tests into groups based on the number of containers we have
++ set -eo pipefail && circleci tests split --split-by=timings --timings-type=filename --index=${CIRCLE_NODE_INDEX} --total=${CIRCLE_NODE_TOTAL} /tmp/all_java_unit_tests.txt > /tmp/java_tests_${CIRCLE_NODE_INDEX}.txt
++ set -eo pipefail && cat /tmp/java_tests_${CIRCLE_NODE_INDEX}.txt | sed "s;^/home/cassandra/cassandra/test/unit/;;g" | grep "Test\.java$" > /tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt
++ echo "** /tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt"
++ cat /tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt
++ no_output_timeout: 15m
++ - run:
++ name: Log Environment Information
++ command: |
++ echo '*** id ***'
++ id
++ echo '*** cat /proc/cpuinfo ***'
++ cat /proc/cpuinfo
++ echo '*** free -m ***'
++ free -m
++ echo '*** df -m ***'
++ df -m
++ echo '*** ifconfig -a ***'
++ ifconfig -a
++ echo '*** uname -a ***'
++ uname -a
++ echo '*** mount ***'
++ mount
++ echo '*** env ***'
++ env
++ echo '*** java ***'
++ which java
++ java -version
++ - run:
++ name: Run Unit Tests (testclasslist-cdc)
++ command: |
++ set -x
++ export PATH=$JAVA_HOME/bin:$PATH
++ time mv ~/cassandra /tmp
++ cd /tmp/cassandra
++ if [ -d ~/dtest_jars ]; then
++ cp ~/dtest_jars/dtest* /tmp/cassandra/build/
++ fi
++ test_timeout=$(grep 'name="test.unit.timeout"' build.xml | awk -F'"' '{print $4}' || true)
++ if [ -z "$test_timeout" ]; then
++ test_timeout=$(grep 'name="test.timeout"' build.xml | awk -F'"' '{print $4}')
++ fi
++ ant testclasslist-cdc -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit
++ no_output_timeout: 15m
++ - store_test_results:
++ path: /tmp/cassandra/build/test/output/
++ - store_artifacts:
++ path: /tmp/cassandra/build/test/output
++ destination: junitxml
++ - store_artifacts:
++ path: /tmp/cassandra/build/test/logs
++ destination: logs
++ environment:
++ - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64
++ - ANT_HOME: /usr/share/ant
++ - LANG: en_US.UTF-8
++ - KEEP_TEST_DIR: true
++ - DEFAULT_DIR: /home/cassandra/cassandra-dtest
++ - PYTHONIOENCODING: utf-8
++ - PYTHONUNBUFFERED: true
++ - CASS_DRIVER_NO_EXTENSIONS: true
++ - CASS_DRIVER_NO_CYTHON: true
++ - CASSANDRA_SKIP_SYNC: true
++ - DTEST_REPO: https://github.com/apache/cassandra-dtest.git
++ - DTEST_BRANCH: trunk
++ - CCM_MAX_HEAP_SIZE: 1024M
++ - CCM_HEAP_NEWSIZE: 256M
++ - REPEATED_TESTS_STOP_ON_FAILURE: false
++ - REPEATED_UTESTS: null
++ - REPEATED_UTESTS_COUNT: 500
++ - REPEATED_UTESTS_LONG: null
++ - REPEATED_UTESTS_LONG_COUNT: 100
++ - REPEATED_UTESTS_STRESS: null
++ - REPEATED_UTESTS_STRESS_COUNT: 500
++ - REPEATED_JVM_DTESTS: null
++ - REPEATED_JVM_DTESTS_COUNT: 500
++ - REPEATED_JVM_UPGRADE_DTESTS: null
++ - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500
++ - REPEATED_DTESTS: null
++ - REPEATED_DTESTS_COUNT: 500
++ - REPEATED_UPGRADE_DTESTS: null
++ - REPEATED_UPGRADE_DTESTS_COUNT: 25
++ - REPEATED_ANT_TEST_TARGET: testsome
++ - REPEATED_ANT_TEST_CLASS: null
++ - REPEATED_ANT_TEST_METHODS: null
++ - REPEATED_ANT_TEST_COUNT: 500
++ - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
++ - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ utests_stress:
+ docker:
+ - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
+ resource_class: medium
+ working_directory: ~/
+ shell: /bin/bash -eo pipefail -l
+ parallelism: 1
+ steps:
+ - attach_workspace:
+ at: /home/cassandra
+ - run:
+ name: Run Unit Tests (stress-test)
+ command: |
+ export PATH=$JAVA_HOME/bin:$PATH
+ time mv ~/cassandra /tmp
+ cd /tmp/cassandra
+ if [ -d ~/dtest_jars ]; then
+ cp ~/dtest_jars/dtest* /tmp/cassandra/build/
+ fi
+ ant stress-test -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit
+ no_output_timeout: 15m
+ - store_test_results:
+ path: /tmp/cassandra/build/test/output/
- store_artifacts:
- path: /tmp/results/repeated_utests/output
+ path: /tmp/cassandra/build/test/output
destination: junitxml
- store_artifacts:
- path: /tmp/results/repeated_utests/logs
+ path: /tmp/cassandra/build/test/logs
destination: logs
environment:
- JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64
@@@ -1856,6 -1616,13 +2007,15 @@@
tests=$(echo ${REPEATED_JVM_DTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=test-jvm-dtest-some
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -1874,9 -1641,8 +2034,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -2050,9 -1814,8 +2209,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name="-Dtest.name=$class_name"
else
name="-Dtest.name=$class_path"
@@@ -2265,22 -2026,20 +2423,205 @@@
- REPEATED_UTESTS_COUNT: 500
- REPEATED_UTESTS_LONG: null
- REPEATED_UTESTS_LONG_COUNT: 100
+ - REPEATED_UTESTS_STRESS: null
+ - REPEATED_UTESTS_STRESS_COUNT: 500
+ - REPEATED_JVM_DTESTS: null
+ - REPEATED_JVM_DTESTS_COUNT: 500
+ - REPEATED_JVM_UPGRADE_DTESTS: null
+ - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500
+ - REPEATED_DTESTS: null
+ - REPEATED_DTESTS_COUNT: 500
+ - REPEATED_UPGRADE_DTESTS: null
+ - REPEATED_UPGRADE_DTESTS_COUNT: 25
+ - REPEATED_ANT_TEST_TARGET: testsome
+ - REPEATED_ANT_TEST_CLASS: null
+ - REPEATED_ANT_TEST_METHODS: null
+ - REPEATED_ANT_TEST_COUNT: 500
+ - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
++ utests_cdc_repeat:
++ docker:
++ - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
++ resource_class: medium
++ working_directory: ~/
++ shell: /bin/bash -eo pipefail -l
++ parallelism: 4
++ steps:
++ - attach_workspace:
++ at: /home/cassandra
++ - run:
++ name: Log Environment Information
++ command: |
++ echo '*** id ***'
++ id
++ echo '*** cat /proc/cpuinfo ***'
++ cat /proc/cpuinfo
++ echo '*** free -m ***'
++ free -m
++ echo '*** df -m ***'
++ df -m
++ echo '*** ifconfig -a ***'
++ ifconfig -a
++ echo '*** uname -a ***'
++ uname -a
++ echo '*** mount ***'
++ mount
++ echo '*** env ***'
++ env
++ echo '*** java ***'
++ which java
++ java -version
++ - run:
++ name: Repeatedly run new or modifed JUnit tests
++ no_output_timeout: 15m
++ command: |
++ set -x
++ export PATH=$JAVA_HOME/bin:$PATH
++ time mv ~/cassandra /tmp
++ cd /tmp/cassandra
++ if [ -d ~/dtest_jars ]; then
++ cp ~/dtest_jars/dtest* /tmp/cassandra/build/
++ fi
++
++ # Calculate the number of test iterations to be run by the current parallel runner.
++ count=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))
++ if (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then
++ count=$((count+1))
++ fi
++
++ # Put manually specified tests and automatically detected tests together, removing duplicates
++ tests=$(echo ${REPEATED_UTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
++ echo "Tests to be repeated: ${tests}"
++
++ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
++ target=test-cdc
++ testtag=""
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
++ testtag="compression"
++ fi
++
++ # Run each test class as many times as requested.
++ exit_code="$?"
++ for test in $tests; do
++
++ # Split class and method names from the test name
++ if [[ $test =~ "#" ]]; then
++ class=${test%"#"*}
++ method=${test#*"#"}
++ else
++ class=$test
++ method=""
++ fi
++
++ # Prepare the -Dtest.name argument.
++ # It can be the fully qualified class name or the short class name, depending on the target.
++ if [[ $target == "test" || \
++ $target == "test-cdc" || \
++ $target == "test-compression" || \
++ $target == "long-test" || \
++ $target == "stress-test" ]]; then
++ name_arg="-Dtest.name=${class##*.}"
++ else
++ name_arg="-Dtest.name=$class"
++ fi
++
++ # Prepare the -Dtest.methods argument, which is optional
++ if [[ $method == "" ]]; then
++ methods_arg=""
++ else
++ methods_arg="-Dtest.methods=$method"
++ fi
++
++ for i in $(seq -w 1 $count); do
++ echo "Running test $test, iteration $i of $count"
++
++ # run the test
++ status="passes"
++ if !( set -o pipefail && \
++ ant test-cdc $name_arg $methods_arg -Dno-build-test=true | \
++ tee stdout.txt \
++ ); then
++ status="fails"
++ exit_code=1
++ fi
++
++ # move the stdout output file
++ dest=/tmp/results/repeated_utests/stdout/${status}/${i}
++ mkdir -p $dest
++ mv stdout.txt $dest/${test}.txt
++
++ # move the XML output files
++ source=build/test/output/${testtag}
++ dest=/tmp/results/repeated_utests/output/${status}/${i}
++ mkdir -p $dest
++ if [[ -d $source && -n "$(ls $source)" ]]; then
++ mv $source/* $dest/
++ fi
++
++ # move the log files
++ source=build/test/logs/${testtag}
++ dest=/tmp/results/repeated_utests/logs/${status}/${i}
++ mkdir -p $dest
++ if [[ -d $source && -n "$(ls $source)" ]]; then
++ mv $source/* $dest/
++ fi
++
++ # maybe stop iterations on test failure
++ if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then
++ break
++ fi
++ done
++ done
++ (exit ${exit_code})
++ - store_test_results:
++ path: /tmp/results/repeated_utests/output
++ - store_artifacts:
++ path: /tmp/results/repeated_utests/stdout
++ destination: stdout
++ - store_artifacts:
++ path: /tmp/results/repeated_utests/output
++ destination: junitxml
++ - store_artifacts:
++ path: /tmp/results/repeated_utests/logs
++ destination: logs
++ environment:
++ - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64
++ - ANT_HOME: /usr/share/ant
++ - LANG: en_US.UTF-8
++ - KEEP_TEST_DIR: true
++ - DEFAULT_DIR: /home/cassandra/cassandra-dtest
++ - PYTHONIOENCODING: utf-8
++ - PYTHONUNBUFFERED: true
++ - CASS_DRIVER_NO_EXTENSIONS: true
++ - CASS_DRIVER_NO_CYTHON: true
++ - CASSANDRA_SKIP_SYNC: true
++ - DTEST_REPO: https://github.com/apache/cassandra-dtest.git
++ - DTEST_BRANCH: trunk
++ - CCM_MAX_HEAP_SIZE: 1024M
++ - CCM_HEAP_NEWSIZE: 256M
++ - REPEATED_TESTS_STOP_ON_FAILURE: false
++ - REPEATED_UTESTS: null
++ - REPEATED_UTESTS_COUNT: 500
++ - REPEATED_UTESTS_LONG: null
++ - REPEATED_UTESTS_LONG_COUNT: 100
++ - REPEATED_UTESTS_STRESS: null
++ - REPEATED_UTESTS_STRESS_COUNT: 500
+ - REPEATED_JVM_DTESTS: null
+ - REPEATED_JVM_DTESTS_COUNT: 500
+ - REPEATED_JVM_UPGRADE_DTESTS: null
+ - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500
+ - REPEATED_DTESTS: null
+ - REPEATED_DTESTS_COUNT: 500
+ - REPEATED_UPGRADE_DTESTS: null
+ - REPEATED_UPGRADE_DTESTS_COUNT: 25
+ - REPEATED_ANT_TEST_TARGET: testsome
+ - REPEATED_ANT_TEST_CLASS: null
+ - REPEATED_ANT_TEST_METHODS: null
+ - REPEATED_ANT_TEST_COUNT: 500
+ - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
j8_jvm_dtests:
docker:
- image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
@@@ -2710,6 -2461,6 +3051,18 @@@ workflows
requires:
- start_utests_long_repeat
- build
++ - start_utests_cdc:
++ type: approval
++ - utests_cdc:
++ requires:
++ - start_utests_cdc
++ - build
++ - start_utests_cdc_repeat:
++ type: approval
++ - utests_cdc_repeat:
++ requires:
++ - start_utests_cdc_repeat
++ - build
- start_utests_compression:
type: approval
- utests_compression:
@@@ -2823,6 -2562,6 +3176,16 @@@
requires:
- start_utests_long
- build
++ - start_utests_cdc:
++ type: approval
++ - utests_cdc:
++ requires:
++ - start_utests_cdc
++ - build
++ - utests_cdc_repeat:
++ requires:
++ - start_utests_cdc
++ - build
- start_utests_compression:
type: approval
- utests_compression:
diff --cc .circleci/config.yml.MIDRES
index 609d0a1026,85f8d70369..9051b2bfbe
--- a/.circleci/config.yml.MIDRES
+++ b/.circleci/config.yml.MIDRES
@@@ -183,6 -181,13 +183,15 @@@ jobs
tests=$(echo ${REPEATED_UTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=test-compression
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -201,9 -206,8 +210,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -288,183 -292,6 +296,191 @@@
- REPEATED_UTESTS_COUNT: 500
- REPEATED_UTESTS_LONG: null
- REPEATED_UTESTS_LONG_COUNT: 100
+ - REPEATED_UTESTS_STRESS: null
+ - REPEATED_UTESTS_STRESS_COUNT: 500
+ - REPEATED_JVM_DTESTS: null
+ - REPEATED_JVM_DTESTS_COUNT: 500
+ - REPEATED_JVM_UPGRADE_DTESTS: null
+ - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500
+ - REPEATED_DTESTS: null
+ - REPEATED_DTESTS_COUNT: 500
+ - REPEATED_UPGRADE_DTESTS: null
+ - REPEATED_UPGRADE_DTESTS_COUNT: 25
+ - REPEATED_ANT_TEST_TARGET: testsome
+ - REPEATED_ANT_TEST_CLASS: null
+ - REPEATED_ANT_TEST_METHODS: null
+ - REPEATED_ANT_TEST_COUNT: 500
+ - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ utests_stress_repeat:
+ docker:
+ - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
+ resource_class: medium
+ working_directory: ~/
+ shell: /bin/bash -eo pipefail -l
+ parallelism: 25
+ steps:
+ - attach_workspace:
+ at: /home/cassandra
+ - run:
+ name: Log Environment Information
+ command: |
+ echo '*** id ***'
+ id
+ echo '*** cat /proc/cpuinfo ***'
+ cat /proc/cpuinfo
+ echo '*** free -m ***'
+ free -m
+ echo '*** df -m ***'
+ df -m
+ echo '*** ifconfig -a ***'
+ ifconfig -a
+ echo '*** uname -a ***'
+ uname -a
+ echo '*** mount ***'
+ mount
+ echo '*** env ***'
+ env
+ echo '*** java ***'
+ which java
+ java -version
+ - run:
+ name: Repeatedly run new or modifed JUnit tests
+ no_output_timeout: 15m
+ command: |
+ set -x
+ export PATH=$JAVA_HOME/bin:$PATH
+ time mv ~/cassandra /tmp
+ cd /tmp/cassandra
+ if [ -d ~/dtest_jars ]; then
+ cp ~/dtest_jars/dtest* /tmp/cassandra/build/
+ fi
+
+ # Calculate the number of test iterations to be run by the current parallel runner.
+ count=$((${REPEATED_UTESTS_STRESS_COUNT} / CIRCLE_NODE_TOTAL))
+ if (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_STRESS_COUNT} % CIRCLE_NODE_TOTAL))); then
+ count=$((count+1))
+ fi
+
+ # Put manually specified tests and automatically detected tests together, removing duplicates
+ tests=$(echo ${REPEATED_UTESTS_STRESS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
+ echo "Tests to be repeated: ${tests}"
+
++ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
++ target=stress-test-some
++ testtag=""
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
++ testtag="compression"
++ fi
++
+ # Run each test class as many times as requested.
+ exit_code="$?"
+ for test in $tests; do
+
+ # Split class and method names from the test name
+ if [[ $test =~ "#" ]]; then
+ class=${test%"#"*}
+ method=${test#*"#"}
+ else
+ class=$test
+ method=""
+ fi
+
+ # Prepare the -Dtest.name argument.
+ # It can be the fully qualified class name or the short class name, depending on the target.
+ if [[ $target == "test" || \
+ $target == "test-cdc" || \
+ $target == "test-compression" || \
- $target == "test-system-keyspace-directory" || \
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
+ name_arg="-Dtest.name=${class##*.}"
+ else
+ name_arg="-Dtest.name=$class"
+ fi
+
+ # Prepare the -Dtest.methods argument, which is optional
- if [ $method == "" ]; then
++ if [[ $method == "" ]]; then
+ methods_arg=""
+ else
+ methods_arg="-Dtest.methods=$method"
+ fi
+
+ for i in $(seq -w 1 $count); do
+ echo "Running test $test, iteration $i of $count"
+
+ # run the test
+ status="passes"
+ if !( set -o pipefail && \
+ ant stress-test-some $name_arg $methods_arg -Dno-build-test=true | \
+ tee stdout.txt \
+ ); then
+ status="fails"
+ exit_code=1
+ fi
+
+ # move the stdout output file
+ dest=/tmp/results/repeated_utests/stdout/${status}/${i}
+ mkdir -p $dest
+ mv stdout.txt $dest/${test}.txt
+
+ # move the XML output files
- source=build/test/output
++ source=build/test/output/${testtag}
+ dest=/tmp/results/repeated_utests/output/${status}/${i}
+ mkdir -p $dest
+ if [[ -d $source && -n "$(ls $source)" ]]; then
+ mv $source/* $dest/
+ fi
+
+ # move the log files
- source=build/test/logs
++ source=build/test/logs/${testtag}
+ dest=/tmp/results/repeated_utests/logs/${status}/${i}
+ mkdir -p $dest
+ if [[ -d $source && -n "$(ls $source)" ]]; then
+ mv $source/* $dest/
+ fi
+
+ # maybe stop iterations on test failure
+ if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then
+ break
+ fi
+ done
+ done
+ (exit ${exit_code})
+ - store_test_results:
+ path: /tmp/results/repeated_utests/output
+ - store_artifacts:
+ path: /tmp/results/repeated_utests/stdout
+ destination: stdout
+ - store_artifacts:
+ path: /tmp/results/repeated_utests/output
+ destination: junitxml
+ - store_artifacts:
+ path: /tmp/results/repeated_utests/logs
+ destination: logs
+ environment:
+ - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - ANT_HOME: /usr/share/ant
+ - LANG: en_US.UTF-8
+ - KEEP_TEST_DIR: true
+ - DEFAULT_DIR: /home/cassandra/cassandra-dtest
+ - PYTHONIOENCODING: utf-8
+ - PYTHONUNBUFFERED: true
+ - CASS_DRIVER_NO_EXTENSIONS: true
+ - CASS_DRIVER_NO_CYTHON: true
+ - CASSANDRA_SKIP_SYNC: true
+ - DTEST_REPO: https://github.com/apache/cassandra-dtest.git
+ - DTEST_BRANCH: trunk
+ - CCM_MAX_HEAP_SIZE: 1024M
+ - CCM_HEAP_NEWSIZE: 256M
+ - REPEATED_TESTS_STOP_ON_FAILURE: false
+ - REPEATED_UTESTS: null
+ - REPEATED_UTESTS_COUNT: 500
+ - REPEATED_UTESTS_LONG: null
+ - REPEATED_UTESTS_LONG_COUNT: 100
+ - REPEATED_UTESTS_STRESS: null
+ - REPEATED_UTESTS_STRESS_COUNT: 500
- REPEATED_JVM_DTESTS: null
- REPEATED_JVM_DTESTS_COUNT: 500
- REPEATED_JVM_UPGRADE_DTESTS: null
@@@ -533,6 -360,13 +549,15 @@@
tests=$(echo ${REPEATED_UTESTS_LONG} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=long-testsome
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -551,9 -385,8 +576,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -708,6 -539,13 +732,15 @@@
tests=$(echo ${REPEATED_UTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=testsome
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -726,9 -564,8 +759,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -1351,6 -1178,13 +1383,15 @@@
tests=$(echo ${REPEATED_JVM_UPGRADE_DTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=test-jvm-dtest-some
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -1369,9 -1203,8 +1410,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -1472,13 -1303,122 +1512,124 @@@
- REPEATED_ANT_TEST_COUNT: 500
- JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
- JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
- j8_unit_tests:
++ utests_cdc:
+ docker:
+ - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
+ resource_class: medium
+ working_directory: ~/
+ shell: /bin/bash -eo pipefail -l
+ parallelism: 25
+ steps:
+ - attach_workspace:
+ at: /home/cassandra
+ - run:
+ name: Determine unit Tests to Run
+ command: |
+ # reminder: this code (along with all the steps) is independently executed on every circle container
+ # so the goal here is to get the circleci script to return the tests *this* container will run
+ # which we do via the `circleci` cli tool.
+
+ rm -fr ~/cassandra-dtest/upgrade_tests
+ echo "***java tests***"
+
+ # get all of our unit test filenames
+ set -eo pipefail && circleci tests glob "$HOME/cassandra/test/unit/**/*.java" > /tmp/all_java_unit_tests.txt
+
+ # split up the unit tests into groups based on the number of containers we have
+ set -eo pipefail && circleci tests split --split-by=timings --timings-type=filename --index=${CIRCLE_NODE_INDEX} --total=${CIRCLE_NODE_TOTAL} /tmp/all_java_unit_tests.txt > /tmp/java_tests_${CIRCLE_NODE_INDEX}.txt
+ set -eo pipefail && cat /tmp/java_tests_${CIRCLE_NODE_INDEX}.txt | sed "s;^/home/cassandra/cassandra/test/unit/;;g" | grep "Test\.java$" > /tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt
+ echo "** /tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt"
+ cat /tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt
+ no_output_timeout: 15m
+ - run:
+ name: Log Environment Information
+ command: |
+ echo '*** id ***'
+ id
+ echo '*** cat /proc/cpuinfo ***'
+ cat /proc/cpuinfo
+ echo '*** free -m ***'
+ free -m
+ echo '*** df -m ***'
+ df -m
+ echo '*** ifconfig -a ***'
+ ifconfig -a
+ echo '*** uname -a ***'
+ uname -a
+ echo '*** mount ***'
+ mount
+ echo '*** env ***'
+ env
+ echo '*** java ***'
+ which java
+ java -version
+ - run:
- name: Run Unit Tests (testclasslist)
++ name: Run Unit Tests (testclasslist-cdc)
+ command: |
+ set -x
+ export PATH=$JAVA_HOME/bin:$PATH
+ time mv ~/cassandra /tmp
+ cd /tmp/cassandra
+ if [ -d ~/dtest_jars ]; then
+ cp ~/dtest_jars/dtest* /tmp/cassandra/build/
+ fi
+ test_timeout=$(grep 'name="test.unit.timeout"' build.xml | awk -F'"' '{print $4}' || true)
+ if [ -z "$test_timeout" ]; then
+ test_timeout=$(grep 'name="test.timeout"' build.xml | awk -F'"' '{print $4}')
+ fi
- ant testclasslist -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit
++ ant testclasslist-cdc -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit
+ no_output_timeout: 15m
+ - store_test_results:
+ path: /tmp/cassandra/build/test/output/
+ - store_artifacts:
+ path: /tmp/cassandra/build/test/output
+ destination: junitxml
+ - store_artifacts:
+ path: /tmp/cassandra/build/test/logs
+ destination: logs
+ environment:
+ - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - ANT_HOME: /usr/share/ant
+ - LANG: en_US.UTF-8
+ - KEEP_TEST_DIR: true
+ - DEFAULT_DIR: /home/cassandra/cassandra-dtest
+ - PYTHONIOENCODING: utf-8
+ - PYTHONUNBUFFERED: true
+ - CASS_DRIVER_NO_EXTENSIONS: true
+ - CASS_DRIVER_NO_CYTHON: true
+ - CASSANDRA_SKIP_SYNC: true
+ - DTEST_REPO: https://github.com/apache/cassandra-dtest.git
+ - DTEST_BRANCH: trunk
+ - CCM_MAX_HEAP_SIZE: 1024M
+ - CCM_HEAP_NEWSIZE: 256M
+ - REPEATED_TESTS_STOP_ON_FAILURE: false
+ - REPEATED_UTESTS: null
+ - REPEATED_UTESTS_COUNT: 500
+ - REPEATED_UTESTS_LONG: null
+ - REPEATED_UTESTS_LONG_COUNT: 100
++ - REPEATED_UTESTS_STRESS: null
++ - REPEATED_UTESTS_STRESS_COUNT: 500
+ - REPEATED_JVM_DTESTS: null
+ - REPEATED_JVM_DTESTS_COUNT: 500
+ - REPEATED_JVM_UPGRADE_DTESTS: null
+ - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500
+ - REPEATED_DTESTS: null
+ - REPEATED_DTESTS_COUNT: 500
+ - REPEATED_UPGRADE_DTESTS: null
+ - REPEATED_UPGRADE_DTESTS_COUNT: 25
+ - REPEATED_ANT_TEST_TARGET: testsome
+ - REPEATED_ANT_TEST_CLASS: null
+ - REPEATED_ANT_TEST_METHODS: null
+ - REPEATED_ANT_TEST_COUNT: 500
+ - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
- j8_dtests:
+ utests_stress:
docker:
- image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
- resource_class: large
+ resource_class: medium
working_directory: ~/
shell: /bin/bash -eo pipefail -l
- parallelism: 50
+ parallelism: 1
steps:
- attach_workspace:
at: /home/cassandra
@@@ -1856,6 -1616,13 +2007,15 @@@
tests=$(echo ${REPEATED_JVM_DTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
echo "Tests to be repeated: ${tests}"
+ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
+ target=test-jvm-dtest-some
+ testtag=""
- if [[ $target == "test-compression" ]]; then
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
+ testtag="compression"
+ fi
+
# Run each test class as many times as requested.
exit_code="$?"
for test in $tests; do
@@@ -1874,9 -1641,8 +2034,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name_arg="-Dtest.name=${class##*.}"
else
name_arg="-Dtest.name=$class"
@@@ -2050,9 -1814,8 +2209,8 @@@
if [[ $target == "test" || \
$target == "test-cdc" || \
$target == "test-compression" || \
-- $target == "test-system-keyspace-directory" || \
- $target == "long-test" ]]; then
+ $target == "long-test" || \
+ $target == "stress-test" ]]; then
name="-Dtest.name=$class_name"
else
name="-Dtest.name=$class_path"
@@@ -2281,13 -2040,13 +2439,196 @@@
- REPEATED_ANT_TEST_COUNT: 500
- JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
- JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
- j8_jvm_dtests:
++ utests_cdc_repeat:
+ docker:
+ - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
+ resource_class: medium
+ working_directory: ~/
+ shell: /bin/bash -eo pipefail -l
- parallelism: 1
++ parallelism: 25
++ steps:
++ - attach_workspace:
++ at: /home/cassandra
++ - run:
++ name: Log Environment Information
++ command: |
++ echo '*** id ***'
++ id
++ echo '*** cat /proc/cpuinfo ***'
++ cat /proc/cpuinfo
++ echo '*** free -m ***'
++ free -m
++ echo '*** df -m ***'
++ df -m
++ echo '*** ifconfig -a ***'
++ ifconfig -a
++ echo '*** uname -a ***'
++ uname -a
++ echo '*** mount ***'
++ mount
++ echo '*** env ***'
++ env
++ echo '*** java ***'
++ which java
++ java -version
++ - run:
++ name: Repeatedly run new or modifed JUnit tests
++ no_output_timeout: 15m
++ command: |
++ set -x
++ export PATH=$JAVA_HOME/bin:$PATH
++ time mv ~/cassandra /tmp
++ cd /tmp/cassandra
++ if [ -d ~/dtest_jars ]; then
++ cp ~/dtest_jars/dtest* /tmp/cassandra/build/
++ fi
++
++ # Calculate the number of test iterations to be run by the current parallel runner.
++ count=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))
++ if (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then
++ count=$((count+1))
++ fi
++
++ # Put manually specified tests and automatically detected tests together, removing duplicates
++ tests=$(echo ${REPEATED_UTESTS} | sed -e "s/<nil>//" | sed -e "s/ //" | tr "," "\n" | tr " " "\n" | sort -n | uniq -u)
++ echo "Tests to be repeated: ${tests}"
++
++ # Prepare the testtag for the target, used by the test macro in build.xml to group the output files
++ target=test-cdc
++ testtag=""
++ if [[ $target == "test-cdc" ]]; then
++ testtag="cdc"
++ elif [[ $target == "test-compression" ]]; then
++ testtag="compression"
++ fi
++
++ # Run each test class as many times as requested.
++ exit_code="$?"
++ for test in $tests; do
++
++ # Split class and method names from the test name
++ if [[ $test =~ "#" ]]; then
++ class=${test%"#"*}
++ method=${test#*"#"}
++ else
++ class=$test
++ method=""
++ fi
++
++ # Prepare the -Dtest.name argument.
++ # It can be the fully qualified class name or the short class name, depending on the target.
++ if [[ $target == "test" || \
++ $target == "test-cdc" || \
++ $target == "test-compression" || \
++ $target == "long-test" || \
++ $target == "stress-test" ]]; then
++ name_arg="-Dtest.name=${class##*.}"
++ else
++ name_arg="-Dtest.name=$class"
++ fi
++
++ # Prepare the -Dtest.methods argument, which is optional
++ if [[ $method == "" ]]; then
++ methods_arg=""
++ else
++ methods_arg="-Dtest.methods=$method"
++ fi
++
++ for i in $(seq -w 1 $count); do
++ echo "Running test $test, iteration $i of $count"
++
++ # run the test
++ status="passes"
++ if !( set -o pipefail && \
++ ant test-cdc $name_arg $methods_arg -Dno-build-test=true | \
++ tee stdout.txt \
++ ); then
++ status="fails"
++ exit_code=1
++ fi
++
++ # move the stdout output file
++ dest=/tmp/results/repeated_utests/stdout/${status}/${i}
++ mkdir -p $dest
++ mv stdout.txt $dest/${test}.txt
++
++ # move the XML output files
++ source=build/test/output/${testtag}
++ dest=/tmp/results/repeated_utests/output/${status}/${i}
++ mkdir -p $dest
++ if [[ -d $source && -n "$(ls $source)" ]]; then
++ mv $source/* $dest/
++ fi
++
++ # move the log files
++ source=build/test/logs/${testtag}
++ dest=/tmp/results/repeated_utests/logs/${status}/${i}
++ mkdir -p $dest
++ if [[ -d $source && -n "$(ls $source)" ]]; then
++ mv $source/* $dest/
++ fi
++
++ # maybe stop iterations on test failure
++ if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then
++ break
++ fi
++ done
++ done
++ (exit ${exit_code})
++ - store_test_results:
++ path: /tmp/results/repeated_utests/output
++ - store_artifacts:
++ path: /tmp/results/repeated_utests/stdout
++ destination: stdout
++ - store_artifacts:
++ path: /tmp/results/repeated_utests/output
++ destination: junitxml
++ - store_artifacts:
++ path: /tmp/results/repeated_utests/logs
++ destination: logs
++ environment:
++ - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64
++ - ANT_HOME: /usr/share/ant
++ - LANG: en_US.UTF-8
++ - KEEP_TEST_DIR: true
++ - DEFAULT_DIR: /home/cassandra/cassandra-dtest
++ - PYTHONIOENCODING: utf-8
++ - PYTHONUNBUFFERED: true
++ - CASS_DRIVER_NO_EXTENSIONS: true
++ - CASS_DRIVER_NO_CYTHON: true
++ - CASSANDRA_SKIP_SYNC: true
++ - DTEST_REPO: https://github.com/apache/cassandra-dtest.git
++ - DTEST_BRANCH: trunk
++ - CCM_MAX_HEAP_SIZE: 1024M
++ - CCM_HEAP_NEWSIZE: 256M
++ - REPEATED_TESTS_STOP_ON_FAILURE: false
++ - REPEATED_UTESTS: null
++ - REPEATED_UTESTS_COUNT: 500
++ - REPEATED_UTESTS_LONG: null
++ - REPEATED_UTESTS_LONG_COUNT: 100
++ - REPEATED_UTESTS_STRESS: null
++ - REPEATED_UTESTS_STRESS_COUNT: 500
++ - REPEATED_JVM_DTESTS: null
++ - REPEATED_JVM_DTESTS_COUNT: 500
++ - REPEATED_JVM_UPGRADE_DTESTS: null
++ - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500
++ - REPEATED_DTESTS: null
++ - REPEATED_DTESTS_COUNT: 500
++ - REPEATED_UPGRADE_DTESTS: null
++ - REPEATED_UPGRADE_DTESTS_COUNT: 25
++ - REPEATED_ANT_TEST_TARGET: testsome
++ - REPEATED_ANT_TEST_CLASS: null
++ - REPEATED_ANT_TEST_METHODS: null
++ - REPEATED_ANT_TEST_COUNT: 500
++ - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
++ - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64
+ j8_jvm_dtests:
+ docker:
+ - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest
+ resource_class: large
+ working_directory: ~/
+ shell: /bin/bash -eo pipefail -l
+ parallelism: 10
steps:
- attach_workspace:
at: /home/cassandra
@@@ -2710,6 -2461,6 +3051,18 @@@ workflows
requires:
- start_utests_long_repeat
- build
++ - start_utests_cdc:
++ type: approval
++ - utests_cdc:
++ requires:
++ - start_utests_cdc
++ - build
++ - start_utests_cdc_repeat:
++ type: approval
++ - utests_cdc_repeat:
++ requires:
++ - start_utests_cdc_repeat
++ - build
- start_utests_compression:
type: approval
- utests_compression:
@@@ -2823,6 -2562,6 +3176,16 @@@
requires:
- start_utests_long
- build
++ - start_utests_cdc:
++ type: approval
++ - utests_cdc:
++ requires:
++ - start_utests_cdc
++ - build
++ - utests_cdc_repeat:
++ requires:
++ - start_utests_cdc
++ - build
- start_utests_compression:
type: approval
- utests_compression:
diff --cc .circleci/generate.sh
index c636631f89,76fe9433c6..8c877b8e7b
--- a/.circleci/generate.sh
+++ b/.circleci/generate.sh
@@@ -247,6 -242,6 +247,7 @@@ delete_job(
if (! (echo "$env_vars" | grep -q "REPEATED_UTESTS=" )); then
delete_job "j8_unit_tests_repeat"
delete_job "j11_unit_tests_repeat"
++ delete_job "utests_cdc_repeat"
delete_job "utests_compression_repeat"
delete_job "utests_system_keyspace_directory_repeat"
fi
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org