diff --git a/.circleci/config.yml b/.circleci/config.yml index 74e5d21c8672..036ca8a6e72c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,35 +18,16 @@ version: 2 jobs: - j8_jvm_upgrade_dtests: + j17_dtests: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra - - run: - name: Determine distributed 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/distributed/**/*.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/distributed/;;g" | grep "Test\.java$" | grep upgrade > /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: | @@ -70,118 +51,37 @@ jobs: which java java -version - run: - name: Run Unit Tests (testclasslist) + name: Clone Cassandra dtest Repository (via git) 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.distributed.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=distributed -Dno-build-test=true - 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: - - 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_FQLTOOL: null - - REPEATED_UTESTS_FQLTOOL_COUNT: 500 - - REPEATED_UTESTS_LONG: null - - REPEATED_UTESTS_LONG_COUNT: 100 - - REPEATED_UTESTS_STRESS: null - - REPEATED_UTESTS_STRESS_COUNT: 500 - - REPEATED_SIMULATOR_DTESTS: null - - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_utests_fqltool_repeat: - docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium - working_directory: ~/ - shell: /bin/bash -eo pipefail -l - parallelism: 4 - steps: - - attach_workspace: - at: /home/cassandra + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - run: - name: Log Environment Information + name: Configure virtualenv and python Dependencies 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 + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.6/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze - run: - name: Repeatedly run new or modifed JUnit tests + name: Determine Tests to Run (j17_without_vnodes) + no_output_timeout: 5m + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j17_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --skip-resource-intensive-tests --pytest-options '-k not cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j17_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j17_without_vnodes_raw /tmp/all_dtest_tests_j17_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j17_without_vnodes_raw > /tmp/all_dtest_tests_j17_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j17_without_vnodes > /tmp/split_dtest_tests_j17_without_vnodes.txt\ncat /tmp/split_dtest_tests_j17_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j17_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j17_without_vnodes_final.txt\n" + - run: + name: Run dtests (j17_without_vnodes) no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_FQLTOOL_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_FQLTOOL_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS_FQLTOOL} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=fqltool-test\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant fqltool-test $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" + command: "echo \"cat /tmp/split_dtest_tests_j17_without_vnodes_final.txt\"\ncat /tmp/split_dtest_tests_j17_without_vnodes_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j17_without_vnodes_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --skip-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j17_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" - store_test_results: - path: /tmp/results/repeated_utests/output - - store_artifacts: - path: /tmp/results/repeated_utests/stdout - destination: stdout + path: /tmp/results - store_artifacts: - path: /tmp/results/repeated_utests/output - destination: junitxml + path: /tmp/dtest + destination: dtest_j17_without_vnodes - store_artifacts: - path: /tmp/results/repeated_utests/logs - destination: logs + path: ~/cassandra-dtest/logs + destination: dtest_j17_without_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -197,7 +97,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -209,23 +109,18 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_cqlshlib_cython_tests: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_cqlshlib_cython_tests: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium @@ -261,7 +156,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -273,29 +168,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_cqlsh_dtests_py311_vnode: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_cqlsh_dtests_py311_offheap: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -316,15 +206,15 @@ jobs: pip3 uninstall -y cqlsh pip3 freeze - run: - name: Determine Tests to Run (j8_with_vnodes) + name: Determine Tests to Run (j17_dtests_offheap) no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.11/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j8_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j8_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j8_with_vnodes_raw /tmp/all_dtest_tests_j8_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j8_with_vnodes_raw > /tmp/all_dtest_tests_j8_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j8_with_vnodes > /tmp/split_dtest_tests_j8_with_vnodes.txt\ncat /tmp/split_dtest_tests_j8_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j8_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j8_with_vnodes_final.txt\n" + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.11/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j17_dtests_offheap)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --use-off-heap-memtables --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j17_dtests_offheap_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j17_dtests_offheap_raw /tmp/all_dtest_tests_j17_dtests_offheap\nelse\n grep -e '' /tmp/all_dtest_tests_j17_dtests_offheap_raw > /tmp/all_dtest_tests_j17_dtests_offheap || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j17_dtests_offheap > /tmp/split_dtest_tests_j17_dtests_offheap.txt\ncat /tmp/split_dtest_tests_j17_dtests_offheap.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j17_dtests_offheap_final.txt\ncat /tmp/split_dtest_tests_j17_dtests_offheap_final.txt\n" - run: - name: Run dtests (j8_with_vnodes) + name: Run dtests (j17_dtests_offheap) no_output_timeout: 15m command: | - echo "cat /tmp/split_dtest_tests_j8_with_vnodes_final.txt" - cat /tmp/split_dtest_tests_j8_with_vnodes_final.txt + echo "cat /tmp/split_dtest_tests_j17_dtests_offheap_final.txt" + cat /tmp/split_dtest_tests_j17_dtests_offheap_final.txt source ~/env3.11/bin/activate export PATH=$JAVA_HOME/bin:$PATH @@ -340,9 +230,9 @@ jobs: echo "** done env" mkdir -p /tmp/results/dtests # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j8_with_vnodes_final.txt` + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j17_dtests_offheap_final.txt` if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j8_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j17_dtests_offheap.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt else echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" (exit 1) @@ -351,10 +241,10 @@ jobs: path: /tmp/results - store_artifacts: path: /tmp/dtest - destination: dtest_j8_with_vnodes + destination: dtest_j17_dtests_offheap - store_artifacts: path: ~/cassandra-dtest/logs - destination: dtest_j8_with_vnodes_logs + destination: dtest_j17_dtests_offheap_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -370,7 +260,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -382,28 +272,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_dtests_vnode_repeat: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_jvm_dtests_vnode_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -430,85 +316,20 @@ jobs: which java java -version - run: - name: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies - command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Run repeated Python DTests + name: Repeatedly run new or modifed JUnit tests no_output_timeout: 15m - command: | - if [ "${REPEATED_DTESTS}" == "" ]; then - echo "Repeated dtest name hasn't been defined, exiting without running any test" - elif [ "${REPEATED_DTESTS_COUNT}" == "" ]; then - echo "Repeated dtest count hasn't been defined, exiting without running any test" - elif [ "${REPEATED_DTESTS_COUNT}" -le 0 ]; then - echo "Repeated dtest count is lesser or equals than zero, exiting without running any test" - else - - # Calculate the number of test iterations to be run by the current parallel runner. - # Since we are running the same test multiple times there is no need to use `circleci tests split`. - count=$((${REPEATED_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) - if (($CIRCLE_NODE_INDEX < (${REPEATED_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then - count=$((count+1)) - fi - - if (($count <= 0)); then - echo "No tests to run in this runner" - else - echo "Running ${REPEATED_DTESTS} $count times" - - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - - tests_arg=$(echo ${REPEATED_DTESTS} | sed -e "s/,/ /g") - - stop_on_failure_arg="" - if ${REPEATED_TESTS_STOP_ON_FAILURE}; then - stop_on_failure_arg="-x" - fi - - vnodes_args="" - if true; then - vnodes_args="--use-vnodes --num-tokens=16" - fi - - upgrade_arg="" - if false; then - upgrade_arg="--execute-upgrade-tests --upgrade-target-version-only --upgrade-version-selection all" - fi - - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $tests_arg | tee /tmp/dtest/stdout.txt - fi - fi + command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_JVM_DTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_JVM_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_JVM_DTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=true\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-jvm-dtest-some\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-jvm-dtest-some $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: - path: /tmp/results + path: /tmp/results/repeated_utests/output - store_artifacts: - path: /tmp/dtest - destination: dtest + path: /tmp/results/repeated_utests/stdout + destination: stdout - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_logs + path: /tmp/results/repeated_utests/output + destination: junitxml + - store_artifacts: + path: /tmp/results/repeated_utests/logs + destination: logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -524,7 +345,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -536,64 +357,64 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_dtests_large_vnode: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_utests_fqltool_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra - run: - name: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies + name: Log Environment Information command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Determine Tests to Run (j8_large_with_vnodes) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j8_large_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --only-resource-intensive-tests --force-resource-intensive-tests --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j8_large_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j8_large_with_vnodes_raw /tmp/all_dtest_tests_j8_large_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j8_large_with_vnodes_raw > /tmp/all_dtest_tests_j8_large_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j8_large_with_vnodes > /tmp/split_dtest_tests_j8_large_with_vnodes.txt\ncat /tmp/split_dtest_tests_j8_large_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j8_large_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j8_large_with_vnodes_final.txt\n" - - run: - name: Run dtests (j8_large_with_vnodes) - no_output_timeout: 15m - command: "echo \"cat /tmp/split_dtest_tests_j8_large_with_vnodes_final.txt\"\ncat /tmp/split_dtest_tests_j8_large_with_vnodes_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j8_large_with_vnodes_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --only-resource-intensive-tests --force-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j8_large_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" - - store_test_results: - path: /tmp/results + 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\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_FQLTOOL_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_FQLTOOL_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS_FQLTOOL} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=fqltool-test\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant fqltool-test $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" + - store_test_results: + path: /tmp/results/repeated_utests/output - store_artifacts: - path: /tmp/dtest - destination: dtest_j8_large_with_vnodes + path: /tmp/results/repeated_utests/stdout + destination: stdout - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_j8_large_with_vnodes_logs + path: /tmp/results/repeated_utests/output + destination: junitxml + - store_artifacts: + path: /tmp/results/repeated_utests/logs + destination: logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -609,7 +430,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -621,96 +442,38 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_utests_system_keyspace_directory: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j11_cqlshlib_cython_tests: docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 1 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-system-keyspace-directory) + name: Run cqlshlib Unit Tests command: | - set -x export PATH=$JAVA_HOME/bin:$PATH + export cython="yes" 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-system-keyspace-directory -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -Dno-build-test=true + cd /tmp/cassandra/ + ./pylib/cassandra-cqlsh-tests.sh $(pwd) 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 + path: /tmp/cassandra/pylib environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -726,7 +489,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -738,14 +501,10 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - REPEATED_UPGRADE_DTESTS: null - - REPEATED_UPGRADE_DTESTS_COUNT: 25 - REPEATED_ANT_TEST_TARGET: testsome - REPEATED_ANT_TEST_CLASS: null - REPEATED_ANT_TEST_METHODS: null @@ -753,36 +512,72 @@ jobs: - REPEATED_ANT_TEST_COUNT: 500 - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_utests_stress: + j17_cqlsh_dtests_py3_offheap: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra - run: - name: Run Unit Tests (stress-test) + name: Clone Cassandra dtest Repository (via git) + command: | + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest + - run: + name: Configure virtualenv and python Dependencies command: | + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.6/bin/activate 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 -Dno-build-test=true + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze + - run: + name: Determine Tests to Run (j17_dtests_offheap) + no_output_timeout: 5m + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j17_dtests_offheap)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --use-off-heap-memtables --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j17_dtests_offheap_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j17_dtests_offheap_raw /tmp/all_dtest_tests_j17_dtests_offheap\nelse\n grep -e '' /tmp/all_dtest_tests_j17_dtests_offheap_raw > /tmp/all_dtest_tests_j17_dtests_offheap || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j17_dtests_offheap > /tmp/split_dtest_tests_j17_dtests_offheap.txt\ncat /tmp/split_dtest_tests_j17_dtests_offheap.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j17_dtests_offheap_final.txt\ncat /tmp/split_dtest_tests_j17_dtests_offheap_final.txt\n" + - run: + name: Run dtests (j17_dtests_offheap) no_output_timeout: 15m + command: | + echo "cat /tmp/split_dtest_tests_j17_dtests_offheap_final.txt" + cat /tmp/split_dtest_tests_j17_dtests_offheap_final.txt + + source ~/env3.6/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + if [ -n 'CQLSH_PYTHON=/usr/bin/python3.6' ]; then + export CQLSH_PYTHON=/usr/bin/python3.6 + fi + + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest + + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j17_dtests_offheap_final.txt` + if [ ! -z "$SPLIT_TESTS" ]; then + set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j17_dtests_offheap.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + else + echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" + (exit 1) + fi - store_test_results: - path: /tmp/cassandra/build/test/output/ + path: /tmp/results - store_artifacts: - path: /tmp/cassandra/build/test/output - destination: junitxml + path: /tmp/dtest + destination: dtest_j17_dtests_offheap - store_artifacts: - path: /tmp/cassandra/build/test/logs - destination: logs + path: ~/cassandra-dtest/logs + destination: dtest_j17_dtests_offheap_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -798,7 +593,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -810,31 +605,46 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_utests_stress_repeat: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_utests_compression: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + 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: | @@ -858,19 +668,28 @@ jobs: which java java -version - run: - name: Repeatedly run new or modifed JUnit tests + name: Run Unit Tests (testclasslist-compression) + 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-compression -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -Dno-build-test=true no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_STRESS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_STRESS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS_STRESS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=stress-test-some\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant stress-test-some $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: - path: /tmp/results/repeated_utests/output - - store_artifacts: - path: /tmp/results/repeated_utests/stdout - destination: stdout + 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: - ANT_HOME: /usr/share/ant @@ -887,7 +706,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -899,29 +718,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_cqlsh_dtests_py311: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_cqlsh_dtests_py38_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -936,26 +750,26 @@ jobs: # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.11/bin/activate + source ~/env3.8/bin/activate export PATH=$JAVA_HOME/bin:$PATH pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt pip3 uninstall -y cqlsh pip3 freeze - run: - name: Determine Tests to Run (j11_without_vnodes) + name: Determine Tests to Run (j17_with_vnodes) no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.11/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_without_vnodes_raw /tmp/all_dtest_tests_j11_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_without_vnodes_raw > /tmp/all_dtest_tests_j11_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_without_vnodes > /tmp/split_dtest_tests_j11_without_vnodes.txt\ncat /tmp/split_dtest_tests_j11_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_without_vnodes_final.txt\n" + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.8/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j17_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j17_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j17_with_vnodes_raw /tmp/all_dtest_tests_j17_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j17_with_vnodes_raw > /tmp/all_dtest_tests_j17_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j17_with_vnodes > /tmp/split_dtest_tests_j17_with_vnodes.txt\ncat /tmp/split_dtest_tests_j17_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j17_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j17_with_vnodes_final.txt\n" - run: - name: Run dtests (j11_without_vnodes) + name: Run dtests (j17_with_vnodes) no_output_timeout: 15m command: | - echo "cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt" - cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt + echo "cat /tmp/split_dtest_tests_j17_with_vnodes_final.txt" + cat /tmp/split_dtest_tests_j17_with_vnodes_final.txt - source ~/env3.11/bin/activate + source ~/env3.8/bin/activate export PATH=$JAVA_HOME/bin:$PATH - if [ -n 'CQLSH_PYTHON=/usr/bin/python3.11' ]; then - export CQLSH_PYTHON=/usr/bin/python3.11 + if [ -n 'CQLSH_PYTHON=/usr/bin/python3.8' ]; then + export CQLSH_PYTHON=/usr/bin/python3.8 fi java -version @@ -966,9 +780,9 @@ jobs: echo "** done env" mkdir -p /tmp/results/dtests # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt` + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j17_with_vnodes_final.txt` if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j17_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt else echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" (exit 1) @@ -977,10 +791,10 @@ jobs: path: /tmp/results - store_artifacts: path: /tmp/dtest - destination: dtest_j11_without_vnodes + destination: dtest_j17_with_vnodes - store_artifacts: path: ~/cassandra-dtest/logs - destination: dtest_j11_without_vnodes_logs + destination: dtest_j17_with_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -996,7 +810,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1008,29 +822,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_utests_trie_repeat: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_dtests_vnode_repeat: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1057,845 +866,85 @@ jobs: which java java -version - run: - name: Repeatedly run new or modifed JUnit tests - no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-trie\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-trie $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - - 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: - - 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_FQLTOOL: null - - REPEATED_UTESTS_FQLTOOL_COUNT: 500 - - REPEATED_UTESTS_LONG: null - - REPEATED_UTESTS_LONG_COUNT: 100 - - REPEATED_UTESTS_STRESS: null - - REPEATED_UTESTS_STRESS_COUNT: 500 - - REPEATED_SIMULATOR_DTESTS: null - - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - - 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_vnode: - 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: Determine distributed 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/distributed/**/*.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/distributed/;;g" | grep "Test\.java$" | grep -v upgrade > /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) - 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.distributed.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.jvm.args='-Dcassandra.dtest.num_tokens=16' -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=distributed -Dno-build-test=true - 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: - - 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_FQLTOOL: null - - REPEATED_UTESTS_FQLTOOL_COUNT: 500 - - REPEATED_UTESTS_LONG: null - - REPEATED_UTESTS_LONG_COUNT: 100 - - REPEATED_UTESTS_STRESS: null - - REPEATED_UTESTS_STRESS_COUNT: 500 - - REPEATED_SIMULATOR_DTESTS: null - - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j8_utests_compression_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\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-compression\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-compression $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - - 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: - - 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_FQLTOOL: null - - REPEATED_UTESTS_FQLTOOL_COUNT: 500 - - REPEATED_UTESTS_LONG: null - - REPEATED_UTESTS_LONG_COUNT: 100 - - REPEATED_UTESTS_STRESS: null - - REPEATED_UTESTS_STRESS_COUNT: 500 - - REPEATED_SIMULATOR_DTESTS: null - - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_unit_tests: - docker: - - image: apache/cassandra-testing-ubuntu2004-java11: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) - 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 -Dno-build-test=true - 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: - - 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_FQLTOOL: null - - REPEATED_UTESTS_FQLTOOL_COUNT: 500 - - REPEATED_UTESTS_LONG: null - - REPEATED_UTESTS_LONG_COUNT: 100 - - REPEATED_UTESTS_STRESS: null - - REPEATED_UTESTS_STRESS_COUNT: 500 - - REPEATED_SIMULATOR_DTESTS: null - - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_cqlsh_dtests_py3: - 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: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies - command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Determine Tests to Run (j8_without_vnodes) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j8_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j8_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j8_without_vnodes_raw /tmp/all_dtest_tests_j8_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j8_without_vnodes_raw > /tmp/all_dtest_tests_j8_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j8_without_vnodes > /tmp/split_dtest_tests_j8_without_vnodes.txt\ncat /tmp/split_dtest_tests_j8_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j8_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j8_without_vnodes_final.txt\n" - - run: - name: Run dtests (j8_without_vnodes) - no_output_timeout: 15m - command: | - echo "cat /tmp/split_dtest_tests_j8_without_vnodes_final.txt" - cat /tmp/split_dtest_tests_j8_without_vnodes_final.txt - - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - if [ -n 'CQLSH_PYTHON=/usr/bin/python3.6' ]; then - export CQLSH_PYTHON=/usr/bin/python3.6 - fi - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j8_without_vnodes_final.txt` - if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j8_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt - else - echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" - (exit 1) - fi - - store_test_results: - path: /tmp/results - - store_artifacts: - path: /tmp/dtest - destination: dtest_j8_without_vnodes - - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_j8_without_vnodes_logs - environment: - - 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_FQLTOOL: null - - REPEATED_UTESTS_FQLTOOL_COUNT: 500 - - REPEATED_UTESTS_LONG: null - - REPEATED_UTESTS_LONG_COUNT: 100 - - REPEATED_UTESTS_STRESS: null - - REPEATED_UTESTS_STRESS_COUNT: 500 - - REPEATED_SIMULATOR_DTESTS: null - - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_cqlsh_dtests_py38: - docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium - working_directory: ~/ - shell: /bin/bash -eo pipefail -l - parallelism: 4 - steps: - - attach_workspace: - at: /home/cassandra - - run: - name: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies - command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.8/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Determine Tests to Run (j11_without_vnodes) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.8/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_without_vnodes_raw /tmp/all_dtest_tests_j11_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_without_vnodes_raw > /tmp/all_dtest_tests_j11_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_without_vnodes > /tmp/split_dtest_tests_j11_without_vnodes.txt\ncat /tmp/split_dtest_tests_j11_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_without_vnodes_final.txt\n" - - run: - name: Run dtests (j11_without_vnodes) - no_output_timeout: 15m - command: | - echo "cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt" - cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt - - source ~/env3.8/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - if [ -n 'CQLSH_PYTHON=/usr/bin/python3.8' ]; then - export CQLSH_PYTHON=/usr/bin/python3.8 - fi - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt` - if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt - else - echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" - (exit 1) - fi - - store_test_results: - path: /tmp/results - - store_artifacts: - path: /tmp/dtest - destination: dtest_j11_without_vnodes - - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_j11_without_vnodes_logs - environment: - - 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_FQLTOOL: null - - REPEATED_UTESTS_FQLTOOL_COUNT: 500 - - REPEATED_UTESTS_LONG: null - - REPEATED_UTESTS_LONG_COUNT: 100 - - REPEATED_UTESTS_STRESS: null - - REPEATED_UTESTS_STRESS_COUNT: 500 - - REPEATED_SIMULATOR_DTESTS: null - - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_utests_compression_repeat: - docker: - - image: apache/cassandra-testing-ubuntu2004-java11: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\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-compression\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-compression $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - - 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: - - 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_FQLTOOL: null - - REPEATED_UTESTS_FQLTOOL_COUNT: 500 - - REPEATED_UTESTS_LONG: null - - REPEATED_UTESTS_LONG_COUNT: 100 - - REPEATED_UTESTS_STRESS: null - - REPEATED_UTESTS_STRESS_COUNT: 500 - - REPEATED_SIMULATOR_DTESTS: null - - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_repeated_ant_test: - docker: - - image: apache/cassandra-testing-ubuntu2004-java11: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: Run repeated JUnit test + name: Clone Cassandra dtest Repository (via git) + command: | + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest + - run: + name: Configure virtualenv and python Dependencies + command: | + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.6/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze + - run: + name: Run repeated Python DTests no_output_timeout: 15m command: | - if [ "${REPEATED_ANT_TEST_CLASS}" == "" ]; then - echo "Repeated utest class name hasn't been defined, exiting without running any test" - elif [ "${REPEATED_ANT_TEST_COUNT}" == "" ]; then - echo "Repeated utest count hasn't been defined, exiting without running any test" - elif [ "${REPEATED_ANT_TEST_COUNT}" -le 0 ]; then - echo "Repeated utest count is lesser or equals than zero, exiting without running any test" - else - - # Calculate the number of test iterations to be run by the current parallel runner. - # Since we are running the same test multiple times there is no need to use `circleci tests split`. - count=$((${REPEATED_ANT_TEST_COUNT} / CIRCLE_NODE_TOTAL)) - if (($CIRCLE_NODE_INDEX < (${REPEATED_ANT_TEST_COUNT} % CIRCLE_NODE_TOTAL))); then - count=$((count+1)) - fi - - if (($count <= 0)); then - echo "No tests to run in this runner" - else - echo "Running ${REPEATED_ANT_TEST_TARGET} ${REPEATED_ANT_TEST_CLASS} ${REPEATED_ANT_TEST_METHODS} ${REPEATED_ANT_TEST_COUNT} times" - - 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 - - target=${REPEATED_ANT_TEST_TARGET} - class_path=${REPEATED_ANT_TEST_CLASS} - class_name="${class_path##*.}" - - # 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-trie" || \ - $target == "test-system-keyspace-directory" || \ - $target == "fqltool-test" || \ - $target == "long-test" || \ - $target == "stress-test" || \ - $target == "test-simulator-dtest" ]]; then - name="-Dtest.name=$class_name" - else - name="-Dtest.name=$class_path" - fi + if [ "${REPEATED_DTESTS}" == "" ]; then + echo "Repeated dtest name hasn't been defined, exiting without running any test" + elif [ "${REPEATED_DTESTS_COUNT}" == "" ]; then + echo "Repeated dtest count hasn't been defined, exiting without running any test" + elif [ "${REPEATED_DTESTS_COUNT}" -le 0 ]; then + echo "Repeated dtest count is lesser or equals than zero, exiting without running any test" + else - # Prepare the -Dtest.methods argument, which is optional - if [ "${REPEATED_ANT_TEST_METHODS}" == "" ]; then - methods="" - else - methods="-Dtest.methods=${REPEATED_ANT_TEST_METHODS}" - fi + # Calculate the number of test iterations to be run by the current parallel runner. + # Since we are running the same test multiple times there is no need to use `circleci tests split`. + count=$((${REPEATED_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) + if (($CIRCLE_NODE_INDEX < (${REPEATED_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then + count=$((count+1)) + fi - # Prepare the JVM dtests vnodes argument, which is optional - vnodes_args="" - if ${REPEATED_ANT_TEST_VNODES}; then - vnodes_args="-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'" - fi + if (($count <= 0)); then + echo "No tests to run in this runner" + else + echo "Running ${REPEATED_DTESTS} $count times" - # Run the test target as many times as requested collecting the exit code, - # stopping the iteration only if stop_on_failure is set. - exit_code="$?" - for i in $(seq -w 1 $count); do + source ~/env3.6/bin/activate + export PATH=$JAVA_HOME/bin:$PATH - echo "Running test iteration $i of $count" + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest - # run the test - status="passes" - if !( set -o pipefail && ant $target $name $methods $vnodes_args -Dno-build-test=true | tee stdout.txt ); then - status="fails" - exit_code=1 - fi + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests - # move the stdout output file - dest=/tmp/results/repeated_utest/stdout/${status}/${i} - mkdir -p $dest - mv stdout.txt $dest/${REPEATED_ANT_TEST_TARGET}-${REPEATED_ANT_TEST_CLASS}.txt + tests_arg=$(echo ${REPEATED_DTESTS} | sed -e "s/,/ /g") - # move the XML output files - source=build/test/output - dest=/tmp/results/repeated_utest/output/${status}/${i} - mkdir -p $dest - if [[ -d $source && -n "$(ls $source)" ]]; then - mv $source/* $dest/ - fi + stop_on_failure_arg="" + if ${REPEATED_TESTS_STOP_ON_FAILURE}; then + stop_on_failure_arg="-x" + fi - # move the log files - source=build/test/logs - dest=/tmp/results/repeated_utest/logs/${status}/${i} - mkdir -p $dest - if [[ -d $source && -n "$(ls $source)" ]]; then - mv $source/* $dest/ - fi + vnodes_args="" + if true; then + vnodes_args="--use-vnodes --num-tokens=16" + fi - # maybe stop iterations on test failure - if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then - break - fi - done + upgrade_arg="" + if false; then + upgrade_arg="--execute-upgrade-tests --upgrade-target-version-only --upgrade-version-selection all" + fi - (exit ${exit_code}) + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $tests_arg | tee /tmp/dtest/stdout.txt fi fi - store_test_results: - path: /tmp/results/repeated_utest/output - - store_artifacts: - path: /tmp/results/repeated_utest/stdout - destination: stdout + path: /tmp/results - store_artifacts: - path: /tmp/results/repeated_utest/output - destination: junitxml + path: /tmp/dtest + destination: dtest - store_artifacts: - path: /tmp/results/repeated_utest/logs - destination: logs + path: ~/cassandra-dtest/logs + destination: dtest_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -1911,7 +960,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1923,29 +972,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_dtests_large_vnode: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_dtests_offheap_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1966,21 +1010,69 @@ jobs: pip3 uninstall -y cqlsh pip3 freeze - run: - name: Determine Tests to Run (j11_large_with_vnodes) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_large_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --only-resource-intensive-tests --force-resource-intensive-tests --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_large_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_large_with_vnodes_raw /tmp/all_dtest_tests_j11_large_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_large_with_vnodes_raw > /tmp/all_dtest_tests_j11_large_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_large_with_vnodes > /tmp/split_dtest_tests_j11_large_with_vnodes.txt\ncat /tmp/split_dtest_tests_j11_large_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_large_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_large_with_vnodes_final.txt\n" - - run: - name: Run dtests (j11_large_with_vnodes) + name: Run repeated Python DTests no_output_timeout: 15m - command: "echo \"cat /tmp/split_dtest_tests_j11_large_with_vnodes_final.txt\"\ncat /tmp/split_dtest_tests_j11_large_with_vnodes_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_large_with_vnodes_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --only-resource-intensive-tests --force-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j11_large_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" + command: | + if [ "${REPEATED_DTESTS}" == "" ]; then + echo "Repeated dtest name hasn't been defined, exiting without running any test" + elif [ "${REPEATED_DTESTS_COUNT}" == "" ]; then + echo "Repeated dtest count hasn't been defined, exiting without running any test" + elif [ "${REPEATED_DTESTS_COUNT}" -le 0 ]; then + echo "Repeated dtest count is lesser or equals than zero, exiting without running any test" + else + + # Calculate the number of test iterations to be run by the current parallel runner. + # Since we are running the same test multiple times there is no need to use `circleci tests split`. + count=$((${REPEATED_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) + if (($CIRCLE_NODE_INDEX < (${REPEATED_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then + count=$((count+1)) + fi + + if (($count <= 0)); then + echo "No tests to run in this runner" + else + echo "Running ${REPEATED_DTESTS} $count times" + + source ~/env3.6/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest + + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests + + tests_arg=$(echo ${REPEATED_DTESTS} | sed -e "s/,/ /g") + + stop_on_failure_arg="" + if ${REPEATED_TESTS_STOP_ON_FAILURE}; then + stop_on_failure_arg="-x" + fi + + vnodes_args="" + if true; then + vnodes_args="--use-vnodes --num-tokens=16" + fi + + upgrade_arg="" + if false; then + upgrade_arg="--execute-upgrade-tests --upgrade-target-version-only --upgrade-version-selection all" + fi + + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir --use-off-heap-memtables --skip-resource-intensive-tests $tests_arg | tee /tmp/dtest/stdout.txt + fi + fi - store_test_results: path: /tmp/results - store_artifacts: path: /tmp/dtest - destination: dtest_j11_large_with_vnodes + destination: dtest - store_artifacts: path: ~/cassandra-dtest/logs - destination: dtest_j11_large_with_vnodes_logs + destination: dtest_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -1996,7 +1088,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2008,29 +1100,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_dtests_large_vnode_repeat: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_dtests_vnode_repeat: docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2054,25 +1141,25 @@ jobs: name: Run repeated Python DTests no_output_timeout: 15m command: | - if [ "${REPEATED_LARGE_DTESTS}" == "" ]; then + if [ "${REPEATED_DTESTS}" == "" ]; then echo "Repeated dtest name hasn't been defined, exiting without running any test" - elif [ "${REPEATED_LARGE_DTESTS_COUNT}" == "" ]; then + elif [ "${REPEATED_DTESTS_COUNT}" == "" ]; then echo "Repeated dtest count hasn't been defined, exiting without running any test" - elif [ "${REPEATED_LARGE_DTESTS_COUNT}" -le 0 ]; then + elif [ "${REPEATED_DTESTS_COUNT}" -le 0 ]; then echo "Repeated dtest count is lesser or equals than zero, exiting without running any test" else # Calculate the number of test iterations to be run by the current parallel runner. # Since we are running the same test multiple times there is no need to use `circleci tests split`. - count=$((${REPEATED_LARGE_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) - if (($CIRCLE_NODE_INDEX < (${REPEATED_LARGE_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then + count=$((${REPEATED_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) + if (($CIRCLE_NODE_INDEX < (${REPEATED_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then count=$((count+1)) fi if (($count <= 0)); then echo "No tests to run in this runner" else - echo "Running ${REPEATED_LARGE_DTESTS} $count times" + echo "Running ${REPEATED_DTESTS} $count times" source ~/env3.6/bin/activate export PATH=$JAVA_HOME/bin:$PATH @@ -2085,35 +1172,148 @@ jobs: echo "** done env" mkdir -p /tmp/results/dtests - tests_arg=$(echo ${REPEATED_LARGE_DTESTS} | sed -e "s/,/ /g") + tests_arg=$(echo ${REPEATED_DTESTS} | sed -e "s/,/ /g") stop_on_failure_arg="" if ${REPEATED_TESTS_STOP_ON_FAILURE}; then stop_on_failure_arg="-x" fi - vnodes_args="" - if true; then - vnodes_args="--use-vnodes --num-tokens=16" - fi + vnodes_args="" + if true; then + vnodes_args="--use-vnodes --num-tokens=16" + fi + + upgrade_arg="" + if false; then + upgrade_arg="--execute-upgrade-tests --upgrade-target-version-only --upgrade-version-selection all" + fi + + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $tests_arg | tee /tmp/dtest/stdout.txt + fi + fi + - store_test_results: + path: /tmp/results + - store_artifacts: + path: /tmp/dtest + destination: dtest + - store_artifacts: + path: ~/cassandra-dtest/logs + destination: dtest_logs + environment: + - 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: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest + - REPEATED_UTESTS_COUNT: 500 + - REPEATED_UTESTS_FQLTOOL: null + - REPEATED_UTESTS_FQLTOOL_COUNT: 500 + - REPEATED_UTESTS_LONG: null + - REPEATED_UTESTS_LONG_COUNT: 100 + - REPEATED_UTESTS_STRESS: null + - REPEATED_UTESTS_STRESS_COUNT: 500 + - REPEATED_SIMULATOR_DTESTS: null + - REPEATED_SIMULATOR_DTESTS_COUNT: 500 + - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS_COUNT: 500 + - REPEATED_DTESTS: null + - REPEATED_DTESTS_COUNT: 500 + - REPEATED_LARGE_DTESTS: null + - REPEATED_LARGE_DTESTS_COUNT: 100 + - REPEATED_ANT_TEST_TARGET: testsome + - REPEATED_ANT_TEST_CLASS: null + - REPEATED_ANT_TEST_METHODS: null + - REPEATED_ANT_TEST_VNODES: false + - REPEATED_ANT_TEST_COUNT: 500 + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j11_utests_system_keyspace_directory: + 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***" - upgrade_arg="" - if false; then - upgrade_arg="--execute-upgrade-tests --upgrade-target-version-only --upgrade-version-selection all" - fi + # get all of our unit test filenames + set -eo pipefail && circleci tests glob "$HOME/cassandra/test/unit/**/*.java" > /tmp/all_java_unit_tests.txt - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir --only-resource-intensive-tests --force-resource-intensive-tests $tests_arg | tee /tmp/dtest/stdout.txt - fi + # 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-system-keyspace-directory) + 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-system-keyspace-directory -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -Dno-build-test=true + no_output_timeout: 15m - store_test_results: - path: /tmp/results + path: /tmp/cassandra/build/test/output/ - store_artifacts: - path: /tmp/dtest - destination: dtest + path: /tmp/cassandra/build/test/output + destination: junitxml - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_logs + path: /tmp/cassandra/build/test/logs + destination: logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -2129,7 +1329,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2141,14 +1341,10 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - REPEATED_UPGRADE_DTESTS: null - - REPEATED_UPGRADE_DTESTS_COUNT: 25 - REPEATED_ANT_TEST_TARGET: testsome - REPEATED_ANT_TEST_CLASS: null - REPEATED_ANT_TEST_METHODS: null @@ -2156,14 +1352,13 @@ jobs: - REPEATED_ANT_TEST_COUNT: 500 - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_cqlsh_dtests_py311: + j17_cqlsh_dtests_py3: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -2178,26 +1373,26 @@ jobs: # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.11/bin/activate + source ~/env3.6/bin/activate export PATH=$JAVA_HOME/bin:$PATH pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt pip3 uninstall -y cqlsh pip3 freeze - run: - name: Determine Tests to Run (j8_without_vnodes) + name: Determine Tests to Run (j17_without_vnodes) no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.11/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j8_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j8_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j8_without_vnodes_raw /tmp/all_dtest_tests_j8_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j8_without_vnodes_raw > /tmp/all_dtest_tests_j8_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j8_without_vnodes > /tmp/split_dtest_tests_j8_without_vnodes.txt\ncat /tmp/split_dtest_tests_j8_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j8_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j8_without_vnodes_final.txt\n" + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j17_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j17_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j17_without_vnodes_raw /tmp/all_dtest_tests_j17_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j17_without_vnodes_raw > /tmp/all_dtest_tests_j17_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j17_without_vnodes > /tmp/split_dtest_tests_j17_without_vnodes.txt\ncat /tmp/split_dtest_tests_j17_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j17_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j17_without_vnodes_final.txt\n" - run: - name: Run dtests (j8_without_vnodes) + name: Run dtests (j17_without_vnodes) no_output_timeout: 15m command: | - echo "cat /tmp/split_dtest_tests_j8_without_vnodes_final.txt" - cat /tmp/split_dtest_tests_j8_without_vnodes_final.txt + echo "cat /tmp/split_dtest_tests_j17_without_vnodes_final.txt" + cat /tmp/split_dtest_tests_j17_without_vnodes_final.txt - source ~/env3.11/bin/activate + source ~/env3.6/bin/activate export PATH=$JAVA_HOME/bin:$PATH - if [ -n 'CQLSH_PYTHON=/usr/bin/python3.11' ]; then - export CQLSH_PYTHON=/usr/bin/python3.11 + if [ -n 'CQLSH_PYTHON=/usr/bin/python3.6' ]; then + export CQLSH_PYTHON=/usr/bin/python3.6 fi java -version @@ -2208,9 +1403,9 @@ jobs: echo "** done env" mkdir -p /tmp/results/dtests # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j8_without_vnodes_final.txt` + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j17_without_vnodes_final.txt` if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j8_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + set -o pipefail && cd ~/cassandra-dtest && pytest --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j17_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt else echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" (exit 1) @@ -2219,10 +1414,10 @@ jobs: path: /tmp/results - store_artifacts: path: /tmp/dtest - destination: dtest_j8_without_vnodes + destination: dtest_j17_without_vnodes - store_artifacts: path: ~/cassandra-dtest/logs - destination: dtest_j8_without_vnodes_logs + destination: dtest_j17_without_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -2238,7 +1433,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2250,87 +1445,64 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_cqlsh_dtests_py38_offheap: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_utests_stress_repeat: docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra - run: - name: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies + name: Log Environment Information command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.8/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Determine Tests to Run (j11_dtests_offheap) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.8/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_dtests_offheap)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --use-off-heap-memtables --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_dtests_offheap_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_dtests_offheap_raw /tmp/all_dtest_tests_j11_dtests_offheap\nelse\n grep -e '' /tmp/all_dtest_tests_j11_dtests_offheap_raw > /tmp/all_dtest_tests_j11_dtests_offheap || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_dtests_offheap > /tmp/split_dtest_tests_j11_dtests_offheap.txt\ncat /tmp/split_dtest_tests_j11_dtests_offheap.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\ncat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\n" + 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 dtests (j11_dtests_offheap) + name: Repeatedly run new or modifed JUnit tests no_output_timeout: 15m - command: | - echo "cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt" - cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt - - source ~/env3.8/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - if [ -n 'CQLSH_PYTHON=/usr/bin/python3.8' ]; then - export CQLSH_PYTHON=/usr/bin/python3.8 - fi - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt` - if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_dtests_offheap.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt - else - echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" - (exit 1) - fi + command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_STRESS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_STRESS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS_STRESS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=stress-test-some\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant stress-test-some $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: - path: /tmp/results + path: /tmp/results/repeated_utests/output - store_artifacts: - path: /tmp/dtest - destination: dtest_j11_dtests_offheap + path: /tmp/results/repeated_utests/stdout + destination: stdout - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_j11_dtests_offheap_logs + path: /tmp/results/repeated_utests/output + destination: junitxml + - store_artifacts: + path: /tmp/results/repeated_utests/logs + destination: logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -2346,7 +1518,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2358,14 +1530,10 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - REPEATED_UPGRADE_DTESTS: null - - REPEATED_UPGRADE_DTESTS_COUNT: 25 - REPEATED_ANT_TEST_TARGET: testsome - REPEATED_ANT_TEST_CLASS: null - REPEATED_ANT_TEST_METHODS: null @@ -2373,49 +1541,81 @@ jobs: - REPEATED_ANT_TEST_COUNT: 500 - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_dtests_large: + j17_unit_tests: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra - run: - name: Clone Cassandra dtest Repository (via git) + name: Determine unit Tests to Run command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest + # 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: Configure virtualenv and python Dependencies + name: Log Environment Information command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Determine Tests to Run (j11_large_without_vnodes) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_large_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --only-resource-intensive-tests --force-resource-intensive-tests --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_large_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_large_without_vnodes_raw /tmp/all_dtest_tests_j11_large_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_large_without_vnodes_raw > /tmp/all_dtest_tests_j11_large_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_large_without_vnodes > /tmp/split_dtest_tests_j11_large_without_vnodes.txt\ncat /tmp/split_dtest_tests_j11_large_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_large_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_large_without_vnodes_final.txt\n" + 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 dtests (j11_large_without_vnodes) + name: Run Unit Tests (testclasslist) + 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 -Dno-build-test=true no_output_timeout: 15m - command: "echo \"cat /tmp/split_dtest_tests_j11_large_without_vnodes_final.txt\"\ncat /tmp/split_dtest_tests_j11_large_without_vnodes_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_large_without_vnodes_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --only-resource-intensive-tests --force-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j11_large_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" - store_test_results: - path: /tmp/results + path: /tmp/cassandra/build/test/output/ - store_artifacts: - path: /tmp/dtest - destination: dtest_j11_large_without_vnodes + path: /tmp/cassandra/build/test/output + destination: junitxml - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_j11_large_without_vnodes_logs + path: /tmp/cassandra/build/test/logs + destination: logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -2431,7 +1631,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2443,29 +1643,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_utests_system_keyspace_directory_repeat: + - REPEATED_ANT_TEST_COUNT: 500 + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_utests_system_keyspace_directory_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2521,7 +1716,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2533,29 +1728,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_cqlsh_dtests_py3_vnode: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_cqlsh_dtests_py311: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -2570,26 +1760,26 @@ jobs: # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.6/bin/activate + source ~/env3.11/bin/activate export PATH=$JAVA_HOME/bin:$PATH pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt pip3 uninstall -y cqlsh pip3 freeze - run: - name: Determine Tests to Run (j8_with_vnodes) + name: Determine Tests to Run (j11_without_vnodes) no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j8_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j8_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j8_with_vnodes_raw /tmp/all_dtest_tests_j8_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j8_with_vnodes_raw > /tmp/all_dtest_tests_j8_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j8_with_vnodes > /tmp/split_dtest_tests_j8_with_vnodes.txt\ncat /tmp/split_dtest_tests_j8_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j8_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j8_with_vnodes_final.txt\n" + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.11/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_without_vnodes_raw /tmp/all_dtest_tests_j11_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_without_vnodes_raw > /tmp/all_dtest_tests_j11_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_without_vnodes > /tmp/split_dtest_tests_j11_without_vnodes.txt\ncat /tmp/split_dtest_tests_j11_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_without_vnodes_final.txt\n" - run: - name: Run dtests (j8_with_vnodes) + name: Run dtests (j11_without_vnodes) no_output_timeout: 15m command: | - echo "cat /tmp/split_dtest_tests_j8_with_vnodes_final.txt" - cat /tmp/split_dtest_tests_j8_with_vnodes_final.txt + echo "cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt" + cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt - source ~/env3.6/bin/activate + source ~/env3.11/bin/activate export PATH=$JAVA_HOME/bin:$PATH - if [ -n 'CQLSH_PYTHON=/usr/bin/python3.6' ]; then - export CQLSH_PYTHON=/usr/bin/python3.6 + if [ -n 'CQLSH_PYTHON=/usr/bin/python3.11' ]; then + export CQLSH_PYTHON=/usr/bin/python3.11 fi java -version @@ -2600,9 +1790,9 @@ jobs: echo "** done env" mkdir -p /tmp/results/dtests # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j8_with_vnodes_final.txt` + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt` if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j8_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + set -o pipefail && cd ~/cassandra-dtest && pytest --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt else echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" (exit 1) @@ -2611,10 +1801,10 @@ jobs: path: /tmp/results - store_artifacts: path: /tmp/dtest - destination: dtest_j8_with_vnodes + destination: dtest_j11_without_vnodes - store_artifacts: path: ~/cassandra-dtest/logs - destination: dtest_j8_with_vnodes_logs + destination: dtest_j11_without_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -2630,7 +1820,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2642,28 +1832,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_cqlsh_dtests_py3: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j17_dtests_large_vnode_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2684,226 +1870,69 @@ jobs: pip3 uninstall -y cqlsh pip3 freeze - run: - name: Determine Tests to Run (j11_without_vnodes) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_without_vnodes_raw /tmp/all_dtest_tests_j11_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_without_vnodes_raw > /tmp/all_dtest_tests_j11_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_without_vnodes > /tmp/split_dtest_tests_j11_without_vnodes.txt\ncat /tmp/split_dtest_tests_j11_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_without_vnodes_final.txt\n" - - run: - name: Run dtests (j11_without_vnodes) + name: Run repeated Python DTests no_output_timeout: 15m command: | - echo "cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt" - cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt + if [ "${REPEATED_LARGE_DTESTS}" == "" ]; then + echo "Repeated dtest name hasn't been defined, exiting without running any test" + elif [ "${REPEATED_LARGE_DTESTS_COUNT}" == "" ]; then + echo "Repeated dtest count hasn't been defined, exiting without running any test" + elif [ "${REPEATED_LARGE_DTESTS_COUNT}" -le 0 ]; then + echo "Repeated dtest count is lesser or equals than zero, exiting without running any test" + else - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - if [ -n 'CQLSH_PYTHON=/usr/bin/python3.6' ]; then - export CQLSH_PYTHON=/usr/bin/python3.6 - fi + # Calculate the number of test iterations to be run by the current parallel runner. + # Since we are running the same test multiple times there is no need to use `circleci tests split`. + count=$((${REPEATED_LARGE_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) + if (($CIRCLE_NODE_INDEX < (${REPEATED_LARGE_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then + count=$((count+1)) + fi - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest + if (($count <= 0)); then + echo "No tests to run in this runner" + else + echo "Running ${REPEATED_LARGE_DTESTS} $count times" - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt` - if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt - else - echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" - (exit 1) - fi - - store_test_results: - path: /tmp/results - - store_artifacts: - path: /tmp/dtest - destination: dtest_j11_without_vnodes - - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_j11_without_vnodes_logs - environment: - - 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_FQLTOOL: null - - REPEATED_UTESTS_FQLTOOL_COUNT: 500 - - REPEATED_UTESTS_LONG: null - - REPEATED_UTESTS_LONG_COUNT: 100 - - REPEATED_UTESTS_STRESS: null - - REPEATED_UTESTS_STRESS_COUNT: 500 - - REPEATED_SIMULATOR_DTESTS: null - - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_cqlshlib_cython_tests: - 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 cqlshlib Unit Tests - command: | - export PATH=$JAVA_HOME/bin:$PATH - export cython="yes" - time mv ~/cassandra /tmp - cd /tmp/cassandra/ - ./pylib/cassandra-cqlsh-tests.sh $(pwd) - no_output_timeout: 15m - - store_test_results: - path: /tmp/cassandra/pylib - environment: - - 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_FQLTOOL: null - - REPEATED_UTESTS_FQLTOOL_COUNT: 500 - - REPEATED_UTESTS_LONG: null - - REPEATED_UTESTS_LONG_COUNT: 100 - - REPEATED_UTESTS_STRESS: null - - REPEATED_UTESTS_STRESS_COUNT: 500 - - REPEATED_SIMULATOR_DTESTS: null - - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_utests_cdc: - docker: - - image: apache/cassandra-testing-ubuntu2004-java11: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. + source ~/env3.6/bin/activate + export PATH=$JAVA_HOME/bin:$PATH - rm -fr ~/cassandra-dtest/upgrade_tests - echo "***java tests***" + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest - # get all of our unit test filenames - set -eo pipefail && circleci tests glob "$HOME/cassandra/test/unit/**/*.java" > /tmp/all_java_unit_tests.txt + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests - # 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}') + tests_arg=$(echo ${REPEATED_LARGE_DTESTS} | sed -e "s/,/ /g") + + stop_on_failure_arg="" + if ${REPEATED_TESTS_STOP_ON_FAILURE}; then + stop_on_failure_arg="-x" + fi + + vnodes_args="" + if true; then + vnodes_args="--use-vnodes --num-tokens=16" + fi + + upgrade_arg="" + if false; then + upgrade_arg="--execute-upgrade-tests --upgrade-target-version-only --upgrade-version-selection all" + fi + + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir --only-resource-intensive-tests --force-resource-intensive-tests $tests_arg | tee /tmp/dtest/stdout.txt + fi fi - ant testclasslist-cdc -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -Dno-build-test=true - no_output_timeout: 15m - store_test_results: - path: /tmp/cassandra/build/test/output/ + path: /tmp/results - store_artifacts: - path: /tmp/cassandra/build/test/output - destination: junitxml + path: /tmp/dtest + destination: dtest - store_artifacts: - path: /tmp/cassandra/build/test/logs - destination: logs + path: ~/cassandra-dtest/logs + destination: dtest_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -2919,7 +1948,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2931,51 +1960,129 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_utests_fqltool: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_dtests_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra - run: - name: Run Unit Tests (fqltool-test) + 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: Clone Cassandra dtest Repository (via git) + command: | + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest + - run: + name: Configure virtualenv and python Dependencies command: | + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.6/bin/activate 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 fqltool-test -Dno-build-test=true + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze + - run: + name: Run repeated Python DTests no_output_timeout: 15m + command: | + if [ "${REPEATED_DTESTS}" == "" ]; then + echo "Repeated dtest name hasn't been defined, exiting without running any test" + elif [ "${REPEATED_DTESTS_COUNT}" == "" ]; then + echo "Repeated dtest count hasn't been defined, exiting without running any test" + elif [ "${REPEATED_DTESTS_COUNT}" -le 0 ]; then + echo "Repeated dtest count is lesser or equals than zero, exiting without running any test" + else + + # Calculate the number of test iterations to be run by the current parallel runner. + # Since we are running the same test multiple times there is no need to use `circleci tests split`. + count=$((${REPEATED_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) + if (($CIRCLE_NODE_INDEX < (${REPEATED_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then + count=$((count+1)) + fi + + if (($count <= 0)); then + echo "No tests to run in this runner" + else + echo "Running ${REPEATED_DTESTS} $count times" + + source ~/env3.6/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest + + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests + + tests_arg=$(echo ${REPEATED_DTESTS} | sed -e "s/,/ /g") + + stop_on_failure_arg="" + if ${REPEATED_TESTS_STOP_ON_FAILURE}; then + stop_on_failure_arg="-x" + fi + + vnodes_args="" + if false; then + vnodes_args="--use-vnodes --num-tokens=16" + fi + + upgrade_arg="" + if false; then + upgrade_arg="--execute-upgrade-tests --upgrade-target-version-only --upgrade-version-selection all" + fi + + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $tests_arg | tee /tmp/dtest/stdout.txt + fi + fi - store_test_results: - path: /tmp/cassandra/build/test/output/ + path: /tmp/results - store_artifacts: - path: /tmp/cassandra/build/test/output - destination: junitxml + path: /tmp/dtest + destination: dtest - store_artifacts: - path: /tmp/cassandra/build/test/logs - destination: logs + path: ~/cassandra-dtest/logs + destination: dtest_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -2991,7 +2098,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3003,29 +2110,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_utests_system_keyspace_directory: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_unit_tests: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -3071,7 +2173,7 @@ jobs: which java java -version - run: - name: Run Unit Tests (testclasslist-system-keyspace-directory) + name: Run Unit Tests (testclasslist) command: | set -x export PATH=$JAVA_HOME/bin:$PATH @@ -3084,7 +2186,7 @@ jobs: if [ -z "$test_timeout" ]; then test_timeout=$(grep 'name="test.timeout"' build.xml | awk -F'"' '{print $4}') fi - ant testclasslist-system-keyspace-directory -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -Dno-build-test=true + ant testclasslist -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -Dno-build-test=true no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -3109,7 +2211,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3121,28 +2223,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - 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_offheap_repeat: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j17_cqlsh_dtests_py311: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -3157,75 +2255,155 @@ jobs: # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.6/bin/activate + source ~/env3.11/bin/activate export PATH=$JAVA_HOME/bin:$PATH pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt pip3 uninstall -y cqlsh pip3 freeze - run: - name: Run repeated Python DTests + name: Determine Tests to Run (j17_without_vnodes) + no_output_timeout: 5m + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.11/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j17_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j17_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j17_without_vnodes_raw /tmp/all_dtest_tests_j17_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j17_without_vnodes_raw > /tmp/all_dtest_tests_j17_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j17_without_vnodes > /tmp/split_dtest_tests_j17_without_vnodes.txt\ncat /tmp/split_dtest_tests_j17_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j17_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j17_without_vnodes_final.txt\n" + - run: + name: Run dtests (j17_without_vnodes) no_output_timeout: 15m command: | - if [ "${REPEATED_DTESTS}" == "" ]; then - echo "Repeated dtest name hasn't been defined, exiting without running any test" - elif [ "${REPEATED_DTESTS_COUNT}" == "" ]; then - echo "Repeated dtest count hasn't been defined, exiting without running any test" - elif [ "${REPEATED_DTESTS_COUNT}" -le 0 ]; then - echo "Repeated dtest count is lesser or equals than zero, exiting without running any test" - else - - # Calculate the number of test iterations to be run by the current parallel runner. - # Since we are running the same test multiple times there is no need to use `circleci tests split`. - count=$((${REPEATED_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) - if (($CIRCLE_NODE_INDEX < (${REPEATED_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then - count=$((count+1)) - fi - - if (($count <= 0)); then - echo "No tests to run in this runner" - else - echo "Running ${REPEATED_DTESTS} $count times" + echo "cat /tmp/split_dtest_tests_j17_without_vnodes_final.txt" + cat /tmp/split_dtest_tests_j17_without_vnodes_final.txt - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests + source ~/env3.11/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + if [ -n 'CQLSH_PYTHON=/usr/bin/python3.11' ]; then + export CQLSH_PYTHON=/usr/bin/python3.11 + fi - tests_arg=$(echo ${REPEATED_DTESTS} | sed -e "s/,/ /g") + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest - stop_on_failure_arg="" - if ${REPEATED_TESTS_STOP_ON_FAILURE}; then - stop_on_failure_arg="-x" - fi + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j17_without_vnodes_final.txt` + if [ ! -z "$SPLIT_TESTS" ]; then + set -o pipefail && cd ~/cassandra-dtest && pytest --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j17_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + else + echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" + (exit 1) + fi + - store_test_results: + path: /tmp/results + - store_artifacts: + path: /tmp/dtest + destination: dtest_j17_without_vnodes + - store_artifacts: + path: ~/cassandra-dtest/logs + destination: dtest_j17_without_vnodes_logs + environment: + - 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: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest + - REPEATED_UTESTS_COUNT: 500 + - REPEATED_UTESTS_FQLTOOL: null + - REPEATED_UTESTS_FQLTOOL_COUNT: 500 + - REPEATED_UTESTS_LONG: null + - REPEATED_UTESTS_LONG_COUNT: 100 + - REPEATED_UTESTS_STRESS: null + - REPEATED_UTESTS_STRESS_COUNT: 500 + - REPEATED_SIMULATOR_DTESTS: null + - REPEATED_SIMULATOR_DTESTS_COUNT: 500 + - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS_COUNT: 500 + - REPEATED_DTESTS: null + - REPEATED_DTESTS_COUNT: 500 + - REPEATED_LARGE_DTESTS: null + - REPEATED_LARGE_DTESTS_COUNT: 100 + - REPEATED_ANT_TEST_TARGET: testsome + - REPEATED_ANT_TEST_CLASS: null + - REPEATED_ANT_TEST_METHODS: null + - REPEATED_ANT_TEST_VNODES: false + - REPEATED_ANT_TEST_COUNT: 500 + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_cqlsh_dtests_py38: + docker: + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + resource_class: large + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 50 + steps: + - attach_workspace: + at: /home/cassandra + - run: + name: Clone Cassandra dtest Repository (via git) + command: | + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest + - run: + name: Configure virtualenv and python Dependencies + command: | + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.8/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze + - run: + name: Determine Tests to Run (j11_without_vnodes) + no_output_timeout: 5m + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.8/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_without_vnodes_raw /tmp/all_dtest_tests_j11_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_without_vnodes_raw > /tmp/all_dtest_tests_j11_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_without_vnodes > /tmp/split_dtest_tests_j11_without_vnodes.txt\ncat /tmp/split_dtest_tests_j11_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_without_vnodes_final.txt\n" + - run: + name: Run dtests (j11_without_vnodes) + no_output_timeout: 15m + command: | + echo "cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt" + cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt - vnodes_args="" - if true; then - vnodes_args="--use-vnodes --num-tokens=16" - fi + source ~/env3.8/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + if [ -n 'CQLSH_PYTHON=/usr/bin/python3.8' ]; then + export CQLSH_PYTHON=/usr/bin/python3.8 + fi - upgrade_arg="" - if false; then - upgrade_arg="--execute-upgrade-tests --upgrade-target-version-only --upgrade-version-selection all" - fi + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir --use-off-heap-memtables --skip-resource-intensive-tests $tests_arg | tee /tmp/dtest/stdout.txt - fi + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt` + if [ ! -z "$SPLIT_TESTS" ]; then + set -o pipefail && cd ~/cassandra-dtest && pytest --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + else + echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" + (exit 1) fi - store_test_results: path: /tmp/results - store_artifacts: path: /tmp/dtest - destination: dtest + destination: dtest_j11_without_vnodes - store_artifacts: path: ~/cassandra-dtest/logs - destination: dtest_logs + destination: dtest_j11_without_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -3241,7 +2419,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3253,111 +2431,64 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_dtests_offheap_repeat: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j17_utests_stress_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra - run: - name: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies + name: Log Environment Information command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze + 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 repeated Python DTests + name: Repeatedly run new or modifed JUnit tests no_output_timeout: 15m - command: | - if [ "${REPEATED_DTESTS}" == "" ]; then - echo "Repeated dtest name hasn't been defined, exiting without running any test" - elif [ "${REPEATED_DTESTS_COUNT}" == "" ]; then - echo "Repeated dtest count hasn't been defined, exiting without running any test" - elif [ "${REPEATED_DTESTS_COUNT}" -le 0 ]; then - echo "Repeated dtest count is lesser or equals than zero, exiting without running any test" - else - - # Calculate the number of test iterations to be run by the current parallel runner. - # Since we are running the same test multiple times there is no need to use `circleci tests split`. - count=$((${REPEATED_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) - if (($CIRCLE_NODE_INDEX < (${REPEATED_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then - count=$((count+1)) - fi - - if (($count <= 0)); then - echo "No tests to run in this runner" - else - echo "Running ${REPEATED_DTESTS} $count times" - - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - - tests_arg=$(echo ${REPEATED_DTESTS} | sed -e "s/,/ /g") - - stop_on_failure_arg="" - if ${REPEATED_TESTS_STOP_ON_FAILURE}; then - stop_on_failure_arg="-x" - fi - - vnodes_args="" - if true; then - vnodes_args="--use-vnodes --num-tokens=16" - fi - - upgrade_arg="" - if false; then - upgrade_arg="--execute-upgrade-tests --upgrade-target-version-only --upgrade-version-selection all" - fi - - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir --use-off-heap-memtables --skip-resource-intensive-tests $tests_arg | tee /tmp/dtest/stdout.txt - fi - fi + command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_STRESS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_STRESS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS_STRESS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=stress-test-some\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant stress-test-some $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: - path: /tmp/results + path: /tmp/results/repeated_utests/output - store_artifacts: - path: /tmp/dtest - destination: dtest + path: /tmp/results/repeated_utests/stdout + destination: stdout - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_logs + path: /tmp/results/repeated_utests/output + destination: junitxml + - store_artifacts: + path: /tmp/results/repeated_utests/logs + destination: logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -3373,7 +2504,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3385,112 +2516,64 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_dtests_large_repeat: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_utests_compression_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra - run: - name: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies + name: Log Environment Information command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze + 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 repeated Python DTests + name: Repeatedly run new or modifed JUnit tests no_output_timeout: 15m - command: | - if [ "${REPEATED_LARGE_DTESTS}" == "" ]; then - echo "Repeated dtest name hasn't been defined, exiting without running any test" - elif [ "${REPEATED_LARGE_DTESTS_COUNT}" == "" ]; then - echo "Repeated dtest count hasn't been defined, exiting without running any test" - elif [ "${REPEATED_LARGE_DTESTS_COUNT}" -le 0 ]; then - echo "Repeated dtest count is lesser or equals than zero, exiting without running any test" - else - - # Calculate the number of test iterations to be run by the current parallel runner. - # Since we are running the same test multiple times there is no need to use `circleci tests split`. - count=$((${REPEATED_LARGE_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) - if (($CIRCLE_NODE_INDEX < (${REPEATED_LARGE_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then - count=$((count+1)) - fi - - if (($count <= 0)); then - echo "No tests to run in this runner" - else - echo "Running ${REPEATED_LARGE_DTESTS} $count times" - - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - - tests_arg=$(echo ${REPEATED_LARGE_DTESTS} | sed -e "s/,/ /g") - - stop_on_failure_arg="" - if ${REPEATED_TESTS_STOP_ON_FAILURE}; then - stop_on_failure_arg="-x" - fi - - vnodes_args="" - if false; then - vnodes_args="--use-vnodes --num-tokens=16" - fi - - upgrade_arg="" - if false; then - upgrade_arg="--execute-upgrade-tests --upgrade-target-version-only --upgrade-version-selection all" - fi - - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir --only-resource-intensive-tests --force-resource-intensive-tests $tests_arg | tee /tmp/dtest/stdout.txt - fi - fi + command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-compression\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-compression $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: - path: /tmp/results + path: /tmp/results/repeated_utests/output + - store_artifacts: + path: /tmp/results/repeated_utests/stdout + destination: stdout - store_artifacts: - path: /tmp/dtest - destination: dtest + path: /tmp/results/repeated_utests/output + destination: junitxml - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_logs + path: /tmp/results/repeated_utests/logs + destination: logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -3506,7 +2589,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3518,50 +2601,27 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_jvm_dtests_vnode: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j11_repeated_ant_test: docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest + - 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: Determine distributed 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/distributed/**/*.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/distributed/;;g" | grep "Test\.java$" | grep -v upgrade > /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: | @@ -3585,28 +2645,124 @@ jobs: which java java -version - run: - name: Run Unit Tests (testclasslist) + name: Run repeated JUnit test + 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 - test_timeout=$(grep 'name="test.distributed.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}') + if [ "${REPEATED_ANT_TEST_CLASS}" == "" ]; then + echo "Repeated utest class name hasn't been defined, exiting without running any test" + elif [ "${REPEATED_ANT_TEST_COUNT}" == "" ]; then + echo "Repeated utest count hasn't been defined, exiting without running any test" + elif [ "${REPEATED_ANT_TEST_COUNT}" -le 0 ]; then + echo "Repeated utest count is lesser or equals than zero, exiting without running any test" + else + + # Calculate the number of test iterations to be run by the current parallel runner. + # Since we are running the same test multiple times there is no need to use `circleci tests split`. + count=$((${REPEATED_ANT_TEST_COUNT} / CIRCLE_NODE_TOTAL)) + if (($CIRCLE_NODE_INDEX < (${REPEATED_ANT_TEST_COUNT} % CIRCLE_NODE_TOTAL))); then + count=$((count+1)) + fi + + if (($count <= 0)); then + echo "No tests to run in this runner" + else + echo "Running ${REPEATED_ANT_TEST_TARGET} ${REPEATED_ANT_TEST_CLASS} ${REPEATED_ANT_TEST_METHODS} ${REPEATED_ANT_TEST_COUNT} times" + + 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 + + target=${REPEATED_ANT_TEST_TARGET} + class_path=${REPEATED_ANT_TEST_CLASS} + class_name="${class_path##*.}" + + # 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-trie" || \ + $target == "test-system-keyspace-directory" || \ + $target == "fqltool-test" || \ + $target == "long-test" || \ + $target == "stress-test" || \ + $target == "test-simulator-dtest" ]]; then + name="-Dtest.name=$class_name" + else + name="-Dtest.name=$class_path" + fi + + # Prepare the -Dtest.methods argument, which is optional + if [ "${REPEATED_ANT_TEST_METHODS}" == "" ]; then + methods="" + else + methods="-Dtest.methods=${REPEATED_ANT_TEST_METHODS}" + fi + + # Prepare the JVM dtests vnodes argument, which is optional + vnodes_args="" + if ${REPEATED_ANT_TEST_VNODES}; then + vnodes_args="-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'" + fi + + # Run the test target as many times as requested collecting the exit code, + # stopping the iteration only if stop_on_failure is set. + exit_code="$?" + for i in $(seq -w 1 $count); do + + echo "Running test iteration $i of $count" + + # run the test + status="passes" + if !( set -o pipefail && ant $target $name $methods $vnodes_args -Dno-build-test=true | tee stdout.txt ); then + status="fails" + exit_code=1 + fi + + # move the stdout output file + dest=/tmp/results/repeated_utest/stdout/${status}/${i} + mkdir -p $dest + mv stdout.txt $dest/${REPEATED_ANT_TEST_TARGET}-${REPEATED_ANT_TEST_CLASS}.txt + + # move the XML output files + source=build/test/output + dest=/tmp/results/repeated_utest/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 + dest=/tmp/results/repeated_utest/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 + + (exit ${exit_code}) + fi fi - ant testclasslist -Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16' -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=distributed -Dno-build-test=true - no_output_timeout: 15m - store_test_results: - path: /tmp/cassandra/build/test/output/ + path: /tmp/results/repeated_utest/output - store_artifacts: - path: /tmp/cassandra/build/test/output + path: /tmp/results/repeated_utest/stdout + destination: stdout + - store_artifacts: + path: /tmp/results/repeated_utest/output destination: junitxml - store_artifacts: - path: /tmp/cassandra/build/test/logs + path: /tmp/results/repeated_utest/logs destination: logs environment: - ANT_HOME: /usr/share/ant @@ -3623,7 +2779,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3635,14 +2791,10 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - REPEATED_UPGRADE_DTESTS: null - - REPEATED_UPGRADE_DTESTS_COUNT: 25 - REPEATED_ANT_TEST_TARGET: testsome - REPEATED_ANT_TEST_CLASS: null - REPEATED_ANT_TEST_METHODS: null @@ -3650,78 +2802,176 @@ jobs: - REPEATED_ANT_TEST_COUNT: 500 - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_simulator_dtests: + j11_dtests_large_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: xlarge working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 4 steps: - attach_workspace: at: /home/cassandra - run: - name: Determine unit Tests to Run + name: Clone Cassandra dtest Repository (via git) 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 + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest + - run: + name: Configure virtualenv and python Dependencies + command: | + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.6/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze + - run: + name: Determine Tests to Run (j11_large_with_vnodes) + no_output_timeout: 5m + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_large_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --only-resource-intensive-tests --force-resource-intensive-tests --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_large_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_large_with_vnodes_raw /tmp/all_dtest_tests_j11_large_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_large_with_vnodes_raw > /tmp/all_dtest_tests_j11_large_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_large_with_vnodes > /tmp/split_dtest_tests_j11_large_with_vnodes.txt\ncat /tmp/split_dtest_tests_j11_large_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_large_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_large_with_vnodes_final.txt\n" + - run: + name: Run dtests (j11_large_with_vnodes) no_output_timeout: 15m + command: "echo \"cat /tmp/split_dtest_tests_j11_large_with_vnodes_final.txt\"\ncat /tmp/split_dtest_tests_j11_large_with_vnodes_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_large_with_vnodes_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --only-resource-intensive-tests --force-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j11_large_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" + - store_test_results: + path: /tmp/results + - store_artifacts: + path: /tmp/dtest + destination: dtest_j11_large_with_vnodes + - store_artifacts: + path: ~/cassandra-dtest/logs + destination: dtest_j11_large_with_vnodes_logs + environment: + - 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: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest + - REPEATED_UTESTS_COUNT: 500 + - REPEATED_UTESTS_FQLTOOL: null + - REPEATED_UTESTS_FQLTOOL_COUNT: 500 + - REPEATED_UTESTS_LONG: null + - REPEATED_UTESTS_LONG_COUNT: 100 + - REPEATED_UTESTS_STRESS: null + - REPEATED_UTESTS_STRESS_COUNT: 500 + - REPEATED_SIMULATOR_DTESTS: null + - REPEATED_SIMULATOR_DTESTS_COUNT: 500 + - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS_COUNT: 500 + - REPEATED_DTESTS: null + - REPEATED_DTESTS_COUNT: 500 + - REPEATED_LARGE_DTESTS: null + - REPEATED_LARGE_DTESTS_COUNT: 100 + - REPEATED_ANT_TEST_TARGET: testsome + - REPEATED_ANT_TEST_CLASS: null + - REPEATED_ANT_TEST_METHODS: null + - REPEATED_ANT_TEST_VNODES: false + - REPEATED_ANT_TEST_COUNT: 500 + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j11_dtests_large_vnode_repeat: + docker: + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + resource_class: large + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 25 + steps: + - attach_workspace: + at: /home/cassandra - run: - name: Log Environment Information + name: Clone Cassandra dtest Repository (via git) 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 + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - run: - name: Run Simulator Tests + name: Configure virtualenv and python Dependencies command: | - set -x + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.6/bin/activate 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/ + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze + - run: + name: Run repeated Python DTests + no_output_timeout: 15m + command: | + if [ "${REPEATED_LARGE_DTESTS}" == "" ]; then + echo "Repeated dtest name hasn't been defined, exiting without running any test" + elif [ "${REPEATED_LARGE_DTESTS_COUNT}" == "" ]; then + echo "Repeated dtest count hasn't been defined, exiting without running any test" + elif [ "${REPEATED_LARGE_DTESTS_COUNT}" -le 0 ]; then + echo "Repeated dtest count is lesser or equals than zero, exiting without running any test" + else + + # Calculate the number of test iterations to be run by the current parallel runner. + # Since we are running the same test multiple times there is no need to use `circleci tests split`. + count=$((${REPEATED_LARGE_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) + if (($CIRCLE_NODE_INDEX < (${REPEATED_LARGE_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then + count=$((count+1)) + fi + + if (($count <= 0)); then + echo "No tests to run in this runner" + else + echo "Running ${REPEATED_LARGE_DTESTS} $count times" + + source ~/env3.6/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest + + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests + + tests_arg=$(echo ${REPEATED_LARGE_DTESTS} | sed -e "s/,/ /g") + + stop_on_failure_arg="" + if ${REPEATED_TESTS_STOP_ON_FAILURE}; then + stop_on_failure_arg="-x" + fi + + vnodes_args="" + if true; then + vnodes_args="--use-vnodes --num-tokens=16" + fi + + upgrade_arg="" + if false; then + upgrade_arg="--execute-upgrade-tests --upgrade-target-version-only --upgrade-version-selection all" + fi + + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir --only-resource-intensive-tests --force-resource-intensive-tests $tests_arg | tee /tmp/dtest/stdout.txt + fi fi - ant test-simulator-dtest -Dno-build-test=true - no_output_timeout: 30m - store_test_results: - path: /tmp/cassandra/build/test/output/ + path: /tmp/results - store_artifacts: - path: /tmp/cassandra/build/test/output - destination: junitxml + path: /tmp/dtest + destination: dtest - store_artifacts: - path: /tmp/cassandra/build/test/logs - destination: logs + path: ~/cassandra-dtest/logs + destination: dtest_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -3737,7 +2987,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3749,28 +2999,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j8_utests_compression: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j17_utests_trie: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -3816,7 +3062,7 @@ jobs: which java java -version - run: - name: Run Unit Tests (testclasslist-compression) + name: Run Unit Tests (testclasslist-trie) command: | set -x export PATH=$JAVA_HOME/bin:$PATH @@ -3829,7 +3075,7 @@ jobs: if [ -z "$test_timeout" ]; then test_timeout=$(grep 'name="test.timeout"' build.xml | awk -F'"' '{print $4}') fi - ant testclasslist-compression -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -Dno-build-test=true + ant testclasslist-trie -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -Dno-build-test=true no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -3854,7 +3100,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3866,140 +3112,83 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_utests_long: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_cqlsh_dtests_py38_offheap: docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra - run: - name: Run Unit Tests (long-test) + name: Clone Cassandra dtest Repository (via git) 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 long-test -Dno-build-test=true - 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: - - 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_FQLTOOL: null - - REPEATED_UTESTS_FQLTOOL_COUNT: 500 - - REPEATED_UTESTS_LONG: null - - REPEATED_UTESTS_LONG_COUNT: 100 - - REPEATED_UTESTS_STRESS: null - - REPEATED_UTESTS_STRESS_COUNT: 500 - - REPEATED_SIMULATOR_DTESTS: null - - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_unit_tests_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 + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - run: - name: Log Environment Information + name: Configure virtualenv and python Dependencies 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 + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.8/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze - run: - name: Repeatedly run new or modifed JUnit tests + name: Determine Tests to Run (j11_dtests_offheap) + no_output_timeout: 5m + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.8/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_dtests_offheap)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --use-off-heap-memtables --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_dtests_offheap_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_dtests_offheap_raw /tmp/all_dtest_tests_j11_dtests_offheap\nelse\n grep -e '' /tmp/all_dtest_tests_j11_dtests_offheap_raw > /tmp/all_dtest_tests_j11_dtests_offheap || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_dtests_offheap > /tmp/split_dtest_tests_j11_dtests_offheap.txt\ncat /tmp/split_dtest_tests_j11_dtests_offheap.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\ncat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\n" + - run: + name: Run dtests (j11_dtests_offheap) no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=testsome\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant testsome $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" + command: | + echo "cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt" + cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt + + source ~/env3.8/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + if [ -n 'CQLSH_PYTHON=/usr/bin/python3.8' ]; then + export CQLSH_PYTHON=/usr/bin/python3.8 + fi + + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest + + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt` + if [ ! -z "$SPLIT_TESTS" ]; then + set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_dtests_offheap.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + else + echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" + (exit 1) + fi - 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 + path: /tmp/results - store_artifacts: - path: /tmp/results/repeated_utests/logs - destination: logs + path: /tmp/dtest + destination: dtest_j11_dtests_offheap + - store_artifacts: + path: ~/cassandra-dtest/logs + destination: dtest_j11_dtests_offheap_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -4015,7 +3204,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4027,25 +3216,21 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - 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_large: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j11_dtests_large: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: xlarge working_directory: ~/ shell: /bin/bash -eo pipefail -l parallelism: 4 @@ -4069,21 +3254,21 @@ jobs: pip3 uninstall -y cqlsh pip3 freeze - run: - name: Determine Tests to Run (j8_large_without_vnodes) + name: Determine Tests to Run (j11_large_without_vnodes) no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j8_large_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --only-resource-intensive-tests --force-resource-intensive-tests --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j8_large_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j8_large_without_vnodes_raw /tmp/all_dtest_tests_j8_large_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j8_large_without_vnodes_raw > /tmp/all_dtest_tests_j8_large_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j8_large_without_vnodes > /tmp/split_dtest_tests_j8_large_without_vnodes.txt\ncat /tmp/split_dtest_tests_j8_large_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j8_large_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j8_large_without_vnodes_final.txt\n" + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_large_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --only-resource-intensive-tests --force-resource-intensive-tests --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_large_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_large_without_vnodes_raw /tmp/all_dtest_tests_j11_large_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_large_without_vnodes_raw > /tmp/all_dtest_tests_j11_large_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_large_without_vnodes > /tmp/split_dtest_tests_j11_large_without_vnodes.txt\ncat /tmp/split_dtest_tests_j11_large_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_large_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_large_without_vnodes_final.txt\n" - run: - name: Run dtests (j8_large_without_vnodes) + name: Run dtests (j11_large_without_vnodes) no_output_timeout: 15m - command: "echo \"cat /tmp/split_dtest_tests_j8_large_without_vnodes_final.txt\"\ncat /tmp/split_dtest_tests_j8_large_without_vnodes_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j8_large_without_vnodes_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --only-resource-intensive-tests --force-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j8_large_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" + command: "echo \"cat /tmp/split_dtest_tests_j11_large_without_vnodes_final.txt\"\ncat /tmp/split_dtest_tests_j11_large_without_vnodes_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_large_without_vnodes_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --only-resource-intensive-tests --force-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j11_large_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" - store_test_results: path: /tmp/results - store_artifacts: path: /tmp/dtest - destination: dtest_j8_large_without_vnodes + destination: dtest_j11_large_without_vnodes - store_artifacts: path: ~/cassandra-dtest/logs - destination: dtest_j8_large_without_vnodes_logs + destination: dtest_j11_large_without_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -4099,7 +3284,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4111,50 +3296,27 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_simulator_dtests: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j11_utests_system_keyspace_directory_repeat: docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest + - 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: 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: | @@ -4178,24 +3340,19 @@ jobs: which java java -version - run: - name: Run Simulator Tests - 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 - ant test-simulator-dtest -Dno-build-test=true - no_output_timeout: 30m + name: Repeatedly run new or modifed JUnit tests + no_output_timeout: 15m + command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-system-keyspace-directory\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-system-keyspace-directory $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: - path: /tmp/cassandra/build/test/output/ + path: /tmp/results/repeated_utests/output - store_artifacts: - path: /tmp/cassandra/build/test/output + path: /tmp/results/repeated_utests/stdout + destination: stdout + - store_artifacts: + path: /tmp/results/repeated_utests/output destination: junitxml - store_artifacts: - path: /tmp/cassandra/build/test/logs + path: /tmp/results/repeated_utests/logs destination: logs environment: - ANT_HOME: /usr/share/ant @@ -4212,7 +3369,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4224,14 +3381,10 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - REPEATED_UPGRADE_DTESTS: null - - REPEATED_UPGRADE_DTESTS_COUNT: 25 - REPEATED_ANT_TEST_TARGET: testsome - REPEATED_ANT_TEST_CLASS: null - REPEATED_ANT_TEST_METHODS: null @@ -4239,27 +3392,72 @@ jobs: - REPEATED_ANT_TEST_COUNT: 500 - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_utests_stress: + j17_jvm_dtests: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 10 steps: - attach_workspace: at: /home/cassandra - run: - name: Run Unit Tests (stress-test) + name: Determine distributed 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/distributed/**/*.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/distributed/;;g" | grep "Test\.java$" | grep -v upgrade > /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) 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 - ant stress-test -Dno-build-test=true + test_timeout=$(grep 'name="test.distributed.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=distributed -Dno-build-test=true no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -4284,7 +3482,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4296,88 +3494,169 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_cqlsh_dtests_py38_offheap: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_repeated_ant_test: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra - run: - name: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies + name: Log Environment Information command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.8/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Determine Tests to Run (j8_dtests_offheap) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.8/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j8_dtests_offheap)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --use-off-heap-memtables --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j8_dtests_offheap_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j8_dtests_offheap_raw /tmp/all_dtest_tests_j8_dtests_offheap\nelse\n grep -e '' /tmp/all_dtest_tests_j8_dtests_offheap_raw > /tmp/all_dtest_tests_j8_dtests_offheap || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j8_dtests_offheap > /tmp/split_dtest_tests_j8_dtests_offheap.txt\ncat /tmp/split_dtest_tests_j8_dtests_offheap.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j8_dtests_offheap_final.txt\ncat /tmp/split_dtest_tests_j8_dtests_offheap_final.txt\n" + 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 dtests (j8_dtests_offheap) + name: Run repeated JUnit test no_output_timeout: 15m command: | - echo "cat /tmp/split_dtest_tests_j8_dtests_offheap_final.txt" - cat /tmp/split_dtest_tests_j8_dtests_offheap_final.txt + if [ "${REPEATED_ANT_TEST_CLASS}" == "" ]; then + echo "Repeated utest class name hasn't been defined, exiting without running any test" + elif [ "${REPEATED_ANT_TEST_COUNT}" == "" ]; then + echo "Repeated utest count hasn't been defined, exiting without running any test" + elif [ "${REPEATED_ANT_TEST_COUNT}" -le 0 ]; then + echo "Repeated utest count is lesser or equals than zero, exiting without running any test" + else - source ~/env3.8/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - if [ -n 'CQLSH_PYTHON=/usr/bin/python3.8' ]; then - export CQLSH_PYTHON=/usr/bin/python3.8 - fi + # Calculate the number of test iterations to be run by the current parallel runner. + # Since we are running the same test multiple times there is no need to use `circleci tests split`. + count=$((${REPEATED_ANT_TEST_COUNT} / CIRCLE_NODE_TOTAL)) + if (($CIRCLE_NODE_INDEX < (${REPEATED_ANT_TEST_COUNT} % CIRCLE_NODE_TOTAL))); then + count=$((count+1)) + fi + + if (($count <= 0)); then + echo "No tests to run in this runner" + else + echo "Running ${REPEATED_ANT_TEST_TARGET} ${REPEATED_ANT_TEST_CLASS} ${REPEATED_ANT_TEST_METHODS} ${REPEATED_ANT_TEST_COUNT} times" + + 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 + + target=${REPEATED_ANT_TEST_TARGET} + class_path=${REPEATED_ANT_TEST_CLASS} + class_name="${class_path##*.}" + + # 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-trie" || \ + $target == "test-system-keyspace-directory" || \ + $target == "fqltool-test" || \ + $target == "long-test" || \ + $target == "stress-test" || \ + $target == "test-simulator-dtest" ]]; then + name="-Dtest.name=$class_name" + else + name="-Dtest.name=$class_path" + fi + + # Prepare the -Dtest.methods argument, which is optional + if [ "${REPEATED_ANT_TEST_METHODS}" == "" ]; then + methods="" + else + methods="-Dtest.methods=${REPEATED_ANT_TEST_METHODS}" + fi + + # Prepare the JVM dtests vnodes argument, which is optional + vnodes_args="" + if ${REPEATED_ANT_TEST_VNODES}; then + vnodes_args="-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'" + fi + + # Run the test target as many times as requested collecting the exit code, + # stopping the iteration only if stop_on_failure is set. + exit_code="$?" + for i in $(seq -w 1 $count); do + + echo "Running test iteration $i of $count" + + # run the test + status="passes" + if !( set -o pipefail && ant $target $name $methods $vnodes_args -Dno-build-test=true | tee stdout.txt ); then + status="fails" + exit_code=1 + fi + + # move the stdout output file + dest=/tmp/results/repeated_utest/stdout/${status}/${i} + mkdir -p $dest + mv stdout.txt $dest/${REPEATED_ANT_TEST_TARGET}-${REPEATED_ANT_TEST_CLASS}.txt + + # move the XML output files + source=build/test/output + dest=/tmp/results/repeated_utest/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 + dest=/tmp/results/repeated_utest/logs/${status}/${i} + mkdir -p $dest + if [[ -d $source && -n "$(ls $source)" ]]; then + mv $source/* $dest/ + fi - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest + # maybe stop iterations on test failure + if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then + break + fi + done - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j8_dtests_offheap_final.txt` - if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j8_dtests_offheap.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt - else - echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" - (exit 1) + (exit ${exit_code}) + fi fi - store_test_results: - path: /tmp/results + path: /tmp/results/repeated_utest/output - store_artifacts: - path: /tmp/dtest - destination: dtest_j8_dtests_offheap + path: /tmp/results/repeated_utest/stdout + destination: stdout - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_j8_dtests_offheap_logs + path: /tmp/results/repeated_utest/output + destination: junitxml + - store_artifacts: + path: /tmp/results/repeated_utest/logs + destination: logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -4393,7 +3672,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4405,28 +3684,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j8_upgrade_dtests_repeat: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_cqlsh_dtests_py3: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -4447,69 +3722,45 @@ jobs: pip3 uninstall -y cqlsh pip3 freeze - run: - name: Run repeated Python DTests + name: Determine Tests to Run (j11_without_vnodes) + no_output_timeout: 5m + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_without_vnodes_raw /tmp/all_dtest_tests_j11_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_without_vnodes_raw > /tmp/all_dtest_tests_j11_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_without_vnodes > /tmp/split_dtest_tests_j11_without_vnodes.txt\ncat /tmp/split_dtest_tests_j11_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_without_vnodes_final.txt\n" + - run: + name: Run dtests (j11_without_vnodes) no_output_timeout: 15m command: | - if [ "${REPEATED_UPGRADE_DTESTS}" == "" ]; then - echo "Repeated dtest name hasn't been defined, exiting without running any test" - elif [ "${REPEATED_UPGRADE_DTESTS_COUNT}" == "" ]; then - echo "Repeated dtest count hasn't been defined, exiting without running any test" - elif [ "${REPEATED_UPGRADE_DTESTS_COUNT}" -le 0 ]; then - echo "Repeated dtest count is lesser or equals than zero, exiting without running any test" - else - - # Calculate the number of test iterations to be run by the current parallel runner. - # Since we are running the same test multiple times there is no need to use `circleci tests split`. - count=$((${REPEATED_UPGRADE_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) - if (($CIRCLE_NODE_INDEX < (${REPEATED_UPGRADE_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then - count=$((count+1)) - fi - - if (($count <= 0)); then - echo "No tests to run in this runner" - else - echo "Running ${REPEATED_UPGRADE_DTESTS} $count times" - - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - - tests_arg=$(echo ${REPEATED_UPGRADE_DTESTS} | sed -e "s/,/ /g") - - stop_on_failure_arg="" - if ${REPEATED_TESTS_STOP_ON_FAILURE}; then - stop_on_failure_arg="-x" - fi + echo "cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt" + cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt - vnodes_args="" - if false; then - vnodes_args="--use-vnodes --num-tokens=16" - fi + source ~/env3.6/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + if [ -n 'CQLSH_PYTHON=/usr/bin/python3.6' ]; then + export CQLSH_PYTHON=/usr/bin/python3.6 + fi - upgrade_arg="" - if true; then - upgrade_arg="--execute-upgrade-tests --upgrade-target-version-only --upgrade-version-selection all" - fi + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $tests_arg | tee /tmp/dtest/stdout.txt - fi + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt` + if [ ! -z "$SPLIT_TESTS" ]; then + set -o pipefail && cd ~/cassandra-dtest && pytest --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + else + echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" + (exit 1) fi - store_test_results: path: /tmp/results - store_artifacts: path: /tmp/dtest - destination: dtest + destination: dtest_j11_without_vnodes - store_artifacts: path: ~/cassandra-dtest/logs - destination: dtest_logs + destination: dtest_j11_without_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -4525,7 +3776,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4537,31 +3788,25 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_utests_cdc_repeat: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j17_build: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 1 steps: - - attach_workspace: - at: /home/cassandra - run: name: Log Environment Information command: | @@ -4585,20 +3830,39 @@ jobs: which java java -version - run: - name: Repeatedly run new or modifed JUnit tests + name: Clone Cassandra Repository (via git) + command: | + git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH https://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git ~/cassandra + - run: + name: Build Cassandra + command: | + export PATH=$JAVA_HOME/bin:$PATH + cd ~/cassandra + # Loop to prevent failure due to maven-ant-tasks not downloading a jar.. + for x in $(seq 1 3); do + ${ANT_HOME}/bin/ant clean realclean jar + RETURN="$?" + if [ "${RETURN}" -eq "0" ]; then + break + fi + done + # Exit, if we didn't build successfully + if [ "${RETURN}" -ne "0" ]; then + echo "Build failed with exit code: ${RETURN}" + exit ${RETURN} + fi no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-cdc\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-cdc $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - - 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 + - run: + name: Run eclipse-warnings + command: | + export PATH=$JAVA_HOME/bin:$PATH + cd ~/cassandra + ant eclipse-warnings + - persist_to_workspace: + root: /home/cassandra + paths: + - cassandra + - .m2 environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -4614,7 +3878,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4626,32 +3890,46 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_dtests_repeat: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_utests_cdc: docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + 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: | @@ -4675,85 +3953,29 @@ jobs: which java java -version - run: - name: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies - command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Run repeated Python DTests - no_output_timeout: 15m + name: Run Unit Tests (testclasslist-cdc) command: | - if [ "${REPEATED_DTESTS}" == "" ]; then - echo "Repeated dtest name hasn't been defined, exiting without running any test" - elif [ "${REPEATED_DTESTS_COUNT}" == "" ]; then - echo "Repeated dtest count hasn't been defined, exiting without running any test" - elif [ "${REPEATED_DTESTS_COUNT}" -le 0 ]; then - echo "Repeated dtest count is lesser or equals than zero, exiting without running any test" - else - - # Calculate the number of test iterations to be run by the current parallel runner. - # Since we are running the same test multiple times there is no need to use `circleci tests split`. - count=$((${REPEATED_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) - if (($CIRCLE_NODE_INDEX < (${REPEATED_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then - count=$((count+1)) - fi - - if (($count <= 0)); then - echo "No tests to run in this runner" - else - echo "Running ${REPEATED_DTESTS} $count times" - - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - - tests_arg=$(echo ${REPEATED_DTESTS} | sed -e "s/,/ /g") - - stop_on_failure_arg="" - if ${REPEATED_TESTS_STOP_ON_FAILURE}; then - stop_on_failure_arg="-x" - fi - - vnodes_args="" - if false; then - vnodes_args="--use-vnodes --num-tokens=16" - fi - - upgrade_arg="" - if false; then - upgrade_arg="--execute-upgrade-tests --upgrade-target-version-only --upgrade-version-selection all" - fi - - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $tests_arg | tee /tmp/dtest/stdout.txt - fi + 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 -Dno-build-test=true + no_output_timeout: 15m - store_test_results: - path: /tmp/results + path: /tmp/cassandra/build/test/output/ - store_artifacts: - path: /tmp/dtest - destination: dtest + path: /tmp/cassandra/build/test/output + destination: junitxml - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_logs + path: /tmp/cassandra/build/test/logs + destination: logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -4769,7 +3991,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4781,14 +4003,10 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - REPEATED_UPGRADE_DTESTS: null - - REPEATED_UPGRADE_DTESTS_COUNT: 25 - REPEATED_ANT_TEST_TARGET: testsome - REPEATED_ANT_TEST_CLASS: null - REPEATED_ANT_TEST_METHODS: null @@ -4796,14 +4014,13 @@ jobs: - REPEATED_ANT_TEST_COUNT: 500 - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_utests_fqltool_repeat: + j17_utests_cdc_repeat: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -4832,7 +4049,7 @@ jobs: - run: name: Repeatedly run new or modifed JUnit tests no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_FQLTOOL_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_FQLTOOL_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS_FQLTOOL} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=fqltool-test\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant fqltool-test $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" + command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-cdc\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-cdc $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: path: /tmp/results/repeated_utests/output - store_artifacts: @@ -4859,7 +4076,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4871,67 +4088,45 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - 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_vnode_repeat: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_utests_fqltool: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 1 steps: - attach_workspace: at: /home/cassandra - run: - name: Log Environment Information + name: Run Unit Tests (fqltool-test) 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 + 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 fqltool-test -Dno-build-test=true no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_JVM_DTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_JVM_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_JVM_DTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=true\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-jvm-dtest-some\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-jvm-dtest-some $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: - path: /tmp/results/repeated_utests/output - - store_artifacts: - path: /tmp/results/repeated_utests/stdout - destination: stdout + 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: - ANT_HOME: /usr/share/ant @@ -4948,7 +4143,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4960,33 +4155,157 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_utests_compression: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j11_dtests_offheap_repeat: docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra - run: - name: Determine unit Tests to Run + name: Clone Cassandra dtest Repository (via git) + command: | + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest + - run: + name: Configure virtualenv and python Dependencies + command: | + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.6/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze + - run: + name: Run repeated Python DTests + no_output_timeout: 15m + command: | + if [ "${REPEATED_DTESTS}" == "" ]; then + echo "Repeated dtest name hasn't been defined, exiting without running any test" + elif [ "${REPEATED_DTESTS_COUNT}" == "" ]; then + echo "Repeated dtest count hasn't been defined, exiting without running any test" + elif [ "${REPEATED_DTESTS_COUNT}" -le 0 ]; then + echo "Repeated dtest count is lesser or equals than zero, exiting without running any test" + else + + # Calculate the number of test iterations to be run by the current parallel runner. + # Since we are running the same test multiple times there is no need to use `circleci tests split`. + count=$((${REPEATED_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) + if (($CIRCLE_NODE_INDEX < (${REPEATED_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then + count=$((count+1)) + fi + + if (($count <= 0)); then + echo "No tests to run in this runner" + else + echo "Running ${REPEATED_DTESTS} $count times" + + source ~/env3.6/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest + + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests + + tests_arg=$(echo ${REPEATED_DTESTS} | sed -e "s/,/ /g") + + stop_on_failure_arg="" + if ${REPEATED_TESTS_STOP_ON_FAILURE}; then + stop_on_failure_arg="-x" + fi + + vnodes_args="" + if true; then + vnodes_args="--use-vnodes --num-tokens=16" + fi + + upgrade_arg="" + if false; then + upgrade_arg="--execute-upgrade-tests --upgrade-target-version-only --upgrade-version-selection all" + fi + + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir --use-off-heap-memtables --skip-resource-intensive-tests $tests_arg | tee /tmp/dtest/stdout.txt + fi + fi + - store_test_results: + path: /tmp/results + - store_artifacts: + path: /tmp/dtest + destination: dtest + - store_artifacts: + path: ~/cassandra-dtest/logs + destination: dtest_logs + environment: + - 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: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest + - REPEATED_UTESTS_COUNT: 500 + - REPEATED_UTESTS_FQLTOOL: null + - REPEATED_UTESTS_FQLTOOL_COUNT: 500 + - REPEATED_UTESTS_LONG: null + - REPEATED_UTESTS_LONG_COUNT: 100 + - REPEATED_UTESTS_STRESS: null + - REPEATED_UTESTS_STRESS_COUNT: 500 + - REPEATED_SIMULATOR_DTESTS: null + - REPEATED_SIMULATOR_DTESTS_COUNT: 500 + - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS_COUNT: 500 + - REPEATED_DTESTS: null + - REPEATED_DTESTS_COUNT: 500 + - REPEATED_LARGE_DTESTS: null + - REPEATED_LARGE_DTESTS_COUNT: 100 + - REPEATED_ANT_TEST_TARGET: testsome + - REPEATED_ANT_TEST_CLASS: null + - REPEATED_ANT_TEST_METHODS: null + - REPEATED_ANT_TEST_VNODES: false + - REPEATED_ANT_TEST_COUNT: 500 + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j11_jvm_dtests_vnode: + 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 + - run: + name: Determine distributed 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 @@ -4996,11 +4315,11 @@ jobs: 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 + set -eo pipefail && circleci tests glob "$HOME/cassandra/test/distributed/**/*.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 + set -eo pipefail && cat /tmp/java_tests_${CIRCLE_NODE_INDEX}.txt | sed "s;^/home/cassandra/cassandra/test/distributed/;;g" | grep "Test\.java$" | grep -v upgrade > /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 @@ -5027,7 +4346,7 @@ jobs: which java java -version - run: - name: Run Unit Tests (testclasslist-compression) + name: Run Unit Tests (testclasslist) command: | set -x export PATH=$JAVA_HOME/bin:$PATH @@ -5036,11 +4355,11 @@ jobs: 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) + test_timeout=$(grep 'name="test.distributed.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-compression -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -Dno-build-test=true + ant testclasslist -Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16' -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=distributed -Dno-build-test=true no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -5065,7 +4384,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5077,14 +4396,10 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - REPEATED_UPGRADE_DTESTS: null - - REPEATED_UPGRADE_DTESTS_COUNT: 25 - REPEATED_ANT_TEST_TARGET: testsome - REPEATED_ANT_TEST_CLASS: null - REPEATED_ANT_TEST_METHODS: null @@ -5092,73 +4407,35 @@ jobs: - REPEATED_ANT_TEST_COUNT: 500 - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_cqlsh_dtests_py38: + j11_utests_long: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 1 steps: - attach_workspace: at: /home/cassandra - run: - name: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies - command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.8/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Determine Tests to Run (j8_without_vnodes) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.8/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j8_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j8_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j8_without_vnodes_raw /tmp/all_dtest_tests_j8_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j8_without_vnodes_raw > /tmp/all_dtest_tests_j8_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j8_without_vnodes > /tmp/split_dtest_tests_j8_without_vnodes.txt\ncat /tmp/split_dtest_tests_j8_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j8_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j8_without_vnodes_final.txt\n" - - run: - name: Run dtests (j8_without_vnodes) - no_output_timeout: 15m - command: | - echo "cat /tmp/split_dtest_tests_j8_without_vnodes_final.txt" - cat /tmp/split_dtest_tests_j8_without_vnodes_final.txt - - source ~/env3.8/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - if [ -n 'CQLSH_PYTHON=/usr/bin/python3.8' ]; then - export CQLSH_PYTHON=/usr/bin/python3.8 - fi - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j8_without_vnodes_final.txt` - if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j8_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt - else - echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" - (exit 1) + name: Run Unit Tests (long-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 long-test -Dno-build-test=true + no_output_timeout: 15m - store_test_results: - path: /tmp/results + path: /tmp/cassandra/build/test/output/ - store_artifacts: - path: /tmp/dtest - destination: dtest_j8_without_vnodes + path: /tmp/cassandra/build/test/output + destination: junitxml - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_j8_without_vnodes_logs + path: /tmp/cassandra/build/test/logs + destination: logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -5174,7 +4451,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5186,87 +4463,64 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_cqlsh_dtests_py3_offheap: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j17_unit_tests_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra - run: - name: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies + name: Log Environment Information command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Determine Tests to Run (j11_dtests_offheap) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_dtests_offheap)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --use-off-heap-memtables --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_dtests_offheap_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_dtests_offheap_raw /tmp/all_dtest_tests_j11_dtests_offheap\nelse\n grep -e '' /tmp/all_dtest_tests_j11_dtests_offheap_raw > /tmp/all_dtest_tests_j11_dtests_offheap || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_dtests_offheap > /tmp/split_dtest_tests_j11_dtests_offheap.txt\ncat /tmp/split_dtest_tests_j11_dtests_offheap.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\ncat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\n" + 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 dtests (j11_dtests_offheap) + name: Repeatedly run new or modifed JUnit tests no_output_timeout: 15m - command: | - echo "cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt" - cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt - - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - if [ -n 'CQLSH_PYTHON=/usr/bin/python3.6' ]; then - export CQLSH_PYTHON=/usr/bin/python3.6 - fi - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt` - if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_dtests_offheap.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt - else - echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" - (exit 1) - fi + command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=testsome\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant testsome $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: - path: /tmp/results + path: /tmp/results/repeated_utests/output - store_artifacts: - path: /tmp/dtest - destination: dtest_j11_dtests_offheap + path: /tmp/results/repeated_utests/stdout + destination: stdout - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_j11_dtests_offheap_logs + path: /tmp/results/repeated_utests/output + destination: junitxml + - store_artifacts: + path: /tmp/results/repeated_utests/logs + destination: logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -5282,7 +4536,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5294,32 +4548,46 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_simulator_dtests_repeat: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_simulator_dtests: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 1 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: | @@ -5343,19 +4611,24 @@ jobs: which java java -version - run: - name: Repeatedly run new or modifed JUnit tests - no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_SIMULATOR_DTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_SIMULATOR_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_SIMULATOR_DTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-simulator-dtest\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-simulator-dtest $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" + name: Run Simulator Tests + 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 + ant test-simulator-dtest -Dno-build-test=true + no_output_timeout: 30m - store_test_results: - path: /tmp/results/repeated_utests/output - - store_artifacts: - path: /tmp/results/repeated_utests/stdout - destination: stdout + 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: - ANT_HOME: /usr/share/ant @@ -5372,7 +4645,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5384,87 +4657,46 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_cqlsh_dtests_py311_offheap: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j11_utests_stress: docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 1 steps: - attach_workspace: at: /home/cassandra - run: - name: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies - command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.11/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Determine Tests to Run (j11_dtests_offheap) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.11/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_dtests_offheap)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --use-off-heap-memtables --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_dtests_offheap_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_dtests_offheap_raw /tmp/all_dtest_tests_j11_dtests_offheap\nelse\n grep -e '' /tmp/all_dtest_tests_j11_dtests_offheap_raw > /tmp/all_dtest_tests_j11_dtests_offheap || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_dtests_offheap > /tmp/split_dtest_tests_j11_dtests_offheap.txt\ncat /tmp/split_dtest_tests_j11_dtests_offheap.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\ncat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\n" - - run: - name: Run dtests (j11_dtests_offheap) - no_output_timeout: 15m + name: Run Unit Tests (stress-test) command: | - echo "cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt" - cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt - - source ~/env3.11/bin/activate export PATH=$JAVA_HOME/bin:$PATH - if [ -n 'CQLSH_PYTHON=/usr/bin/python3.11' ]; then - export CQLSH_PYTHON=/usr/bin/python3.11 - fi - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt` - if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_dtests_offheap.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt - else - echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" - (exit 1) + time mv ~/cassandra /tmp + cd /tmp/cassandra + if [ -d ~/dtest_jars ]; then + cp ~/dtest_jars/dtest* /tmp/cassandra/build/ fi + ant stress-test -Dno-build-test=true + no_output_timeout: 15m - store_test_results: - path: /tmp/results + path: /tmp/cassandra/build/test/output/ - store_artifacts: - path: /tmp/dtest - destination: dtest_j11_dtests_offheap + path: /tmp/cassandra/build/test/output + destination: junitxml - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_j11_dtests_offheap_logs + path: /tmp/cassandra/build/test/logs + destination: logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -5480,7 +4712,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5492,14 +4724,10 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - REPEATED_UPGRADE_DTESTS: null - - REPEATED_UPGRADE_DTESTS_COUNT: 25 - REPEATED_ANT_TEST_TARGET: testsome - REPEATED_ANT_TEST_CLASS: null - REPEATED_ANT_TEST_METHODS: null @@ -5507,14 +4735,13 @@ jobs: - REPEATED_ANT_TEST_COUNT: 500 - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_utests_system_keyspace_directory_repeat: + j11_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 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -5543,7 +4770,7 @@ jobs: - run: name: Repeatedly run new or modifed JUnit tests no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-system-keyspace-directory\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-system-keyspace-directory $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" + command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-cdc\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-cdc $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: path: /tmp/results/repeated_utests/output - store_artifacts: @@ -5570,7 +4797,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5582,50 +4809,27 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_utests_trie: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j17_dtests_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 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: | @@ -5649,29 +4853,37 @@ jobs: which java java -version - run: - name: Run Unit Tests (testclasslist-trie) + name: Clone Cassandra dtest Repository (via git) command: | - set -x + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest + - run: + name: Configure virtualenv and python Dependencies + command: | + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.6/bin/activate 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-trie -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -Dno-build-test=true + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze + - run: + name: Determine Tests to Run (j17_with_vnodes) + no_output_timeout: 5m + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j17_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --skip-resource-intensive-tests --pytest-options '-k not cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j17_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j17_with_vnodes_raw /tmp/all_dtest_tests_j17_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j17_with_vnodes_raw > /tmp/all_dtest_tests_j17_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j17_with_vnodes > /tmp/split_dtest_tests_j17_with_vnodes.txt\ncat /tmp/split_dtest_tests_j17_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j17_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j17_with_vnodes_final.txt\n" + - run: + name: Run dtests (j17_with_vnodes) no_output_timeout: 15m + command: "echo \"cat /tmp/split_dtest_tests_j17_with_vnodes_final.txt\"\ncat /tmp/split_dtest_tests_j17_with_vnodes_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j17_with_vnodes_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --skip-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j17_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" - store_test_results: - path: /tmp/cassandra/build/test/output/ + path: /tmp/results - store_artifacts: - path: /tmp/cassandra/build/test/output - destination: junitxml + path: /tmp/dtest + destination: dtest_j17_with_vnodes - store_artifacts: - path: /tmp/cassandra/build/test/logs - destination: logs + path: ~/cassandra-dtest/logs + destination: dtest_j17_with_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -5687,7 +4899,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5699,29 +4911,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_dtests_large_repeat: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_dtests_repeat: docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -5745,25 +4952,25 @@ jobs: name: Run repeated Python DTests no_output_timeout: 15m command: | - if [ "${REPEATED_LARGE_DTESTS}" == "" ]; then + if [ "${REPEATED_DTESTS}" == "" ]; then echo "Repeated dtest name hasn't been defined, exiting without running any test" - elif [ "${REPEATED_LARGE_DTESTS_COUNT}" == "" ]; then + elif [ "${REPEATED_DTESTS_COUNT}" == "" ]; then echo "Repeated dtest count hasn't been defined, exiting without running any test" - elif [ "${REPEATED_LARGE_DTESTS_COUNT}" -le 0 ]; then + elif [ "${REPEATED_DTESTS_COUNT}" -le 0 ]; then echo "Repeated dtest count is lesser or equals than zero, exiting without running any test" else # Calculate the number of test iterations to be run by the current parallel runner. # Since we are running the same test multiple times there is no need to use `circleci tests split`. - count=$((${REPEATED_LARGE_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) - if (($CIRCLE_NODE_INDEX < (${REPEATED_LARGE_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then + count=$((${REPEATED_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) + if (($CIRCLE_NODE_INDEX < (${REPEATED_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then count=$((count+1)) fi if (($count <= 0)); then echo "No tests to run in this runner" else - echo "Running ${REPEATED_LARGE_DTESTS} $count times" + echo "Running ${REPEATED_DTESTS} $count times" source ~/env3.6/bin/activate export PATH=$JAVA_HOME/bin:$PATH @@ -5776,7 +4983,7 @@ jobs: echo "** done env" mkdir -p /tmp/results/dtests - tests_arg=$(echo ${REPEATED_LARGE_DTESTS} | sed -e "s/,/ /g") + tests_arg=$(echo ${REPEATED_DTESTS} | sed -e "s/,/ /g") stop_on_failure_arg="" if ${REPEATED_TESTS_STOP_ON_FAILURE}; then @@ -5794,7 +5001,7 @@ jobs: fi # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir --only-resource-intensive-tests --force-resource-intensive-tests $tests_arg | tee /tmp/dtest/stdout.txt + set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $tests_arg | tee /tmp/dtest/stdout.txt fi fi - store_test_results: @@ -5820,7 +5027,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5832,14 +5039,10 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - REPEATED_UPGRADE_DTESTS: null - - REPEATED_UPGRADE_DTESTS_COUNT: 25 - REPEATED_ANT_TEST_TARGET: testsome - REPEATED_ANT_TEST_CLASS: null - REPEATED_ANT_TEST_METHODS: null @@ -5847,14 +5050,13 @@ jobs: - REPEATED_ANT_TEST_COUNT: 500 - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_utests_trie: + j11_utests_compression: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -5900,7 +5102,7 @@ jobs: which java java -version - run: - name: Run Unit Tests (testclasslist-trie) + name: Run Unit Tests (testclasslist-compression) command: | set -x export PATH=$JAVA_HOME/bin:$PATH @@ -5913,7 +5115,7 @@ jobs: if [ -z "$test_timeout" ]; then test_timeout=$(grep 'name="test.timeout"' build.xml | awk -F'"' '{print $4}') fi - ant testclasslist-trie -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -Dno-build-test=true + ant testclasslist-compression -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -Dno-build-test=true no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -5938,7 +5140,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5950,28 +5152,109 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j8_cqlsh_dtests_py3_offheap: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j17_utests_trie_repeat: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + 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\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-trie\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-trie $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" + - 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: + - 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: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest + - REPEATED_UTESTS_COUNT: 500 + - REPEATED_UTESTS_FQLTOOL: null + - REPEATED_UTESTS_FQLTOOL_COUNT: 500 + - REPEATED_UTESTS_LONG: null + - REPEATED_UTESTS_LONG_COUNT: 100 + - REPEATED_UTESTS_STRESS: null + - REPEATED_UTESTS_STRESS_COUNT: 500 + - REPEATED_SIMULATOR_DTESTS: null + - REPEATED_SIMULATOR_DTESTS_COUNT: 500 + - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS_COUNT: 500 + - REPEATED_DTESTS: null + - REPEATED_DTESTS_COUNT: 500 + - REPEATED_LARGE_DTESTS: null + - REPEATED_LARGE_DTESTS_COUNT: 100 + - REPEATED_ANT_TEST_TARGET: testsome + - REPEATED_ANT_TEST_CLASS: null + - REPEATED_ANT_TEST_METHODS: null + - REPEATED_ANT_TEST_VNODES: false + - REPEATED_ANT_TEST_COUNT: 500 + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_cqlsh_dtests_py3_offheap: + docker: + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + resource_class: large + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -5992,15 +5275,15 @@ jobs: pip3 uninstall -y cqlsh pip3 freeze - run: - name: Determine Tests to Run (j8_dtests_offheap) + name: Determine Tests to Run (j11_dtests_offheap) no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j8_dtests_offheap)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --use-off-heap-memtables --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j8_dtests_offheap_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j8_dtests_offheap_raw /tmp/all_dtest_tests_j8_dtests_offheap\nelse\n grep -e '' /tmp/all_dtest_tests_j8_dtests_offheap_raw > /tmp/all_dtest_tests_j8_dtests_offheap || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j8_dtests_offheap > /tmp/split_dtest_tests_j8_dtests_offheap.txt\ncat /tmp/split_dtest_tests_j8_dtests_offheap.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j8_dtests_offheap_final.txt\ncat /tmp/split_dtest_tests_j8_dtests_offheap_final.txt\n" + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_dtests_offheap)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --use-off-heap-memtables --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_dtests_offheap_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_dtests_offheap_raw /tmp/all_dtest_tests_j11_dtests_offheap\nelse\n grep -e '' /tmp/all_dtest_tests_j11_dtests_offheap_raw > /tmp/all_dtest_tests_j11_dtests_offheap || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_dtests_offheap > /tmp/split_dtest_tests_j11_dtests_offheap.txt\ncat /tmp/split_dtest_tests_j11_dtests_offheap.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\ncat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\n" - run: - name: Run dtests (j8_dtests_offheap) + name: Run dtests (j11_dtests_offheap) no_output_timeout: 15m command: | - echo "cat /tmp/split_dtest_tests_j8_dtests_offheap_final.txt" - cat /tmp/split_dtest_tests_j8_dtests_offheap_final.txt + echo "cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt" + cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt source ~/env3.6/bin/activate export PATH=$JAVA_HOME/bin:$PATH @@ -6016,9 +5299,113 @@ jobs: echo "** done env" mkdir -p /tmp/results/dtests # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j8_dtests_offheap_final.txt` + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt` + if [ ! -z "$SPLIT_TESTS" ]; then + set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_dtests_offheap.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + else + echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" + (exit 1) + fi + - store_test_results: + path: /tmp/results + - store_artifacts: + path: /tmp/dtest + destination: dtest_j11_dtests_offheap + - store_artifacts: + path: ~/cassandra-dtest/logs + destination: dtest_j11_dtests_offheap_logs + environment: + - 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: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest + - REPEATED_UTESTS_COUNT: 500 + - REPEATED_UTESTS_FQLTOOL: null + - REPEATED_UTESTS_FQLTOOL_COUNT: 500 + - REPEATED_UTESTS_LONG: null + - REPEATED_UTESTS_LONG_COUNT: 100 + - REPEATED_UTESTS_STRESS: null + - REPEATED_UTESTS_STRESS_COUNT: 500 + - REPEATED_SIMULATOR_DTESTS: null + - REPEATED_SIMULATOR_DTESTS_COUNT: 500 + - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS_COUNT: 500 + - REPEATED_DTESTS: null + - REPEATED_DTESTS_COUNT: 500 + - REPEATED_LARGE_DTESTS: null + - REPEATED_LARGE_DTESTS_COUNT: 100 + - REPEATED_ANT_TEST_TARGET: testsome + - REPEATED_ANT_TEST_CLASS: null + - REPEATED_ANT_TEST_METHODS: null + - REPEATED_ANT_TEST_VNODES: false + - REPEATED_ANT_TEST_COUNT: 500 + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j11_cqlsh_dtests_py311_offheap: + docker: + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + resource_class: large + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 50 + steps: + - attach_workspace: + at: /home/cassandra + - run: + name: Clone Cassandra dtest Repository (via git) + command: | + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest + - run: + name: Configure virtualenv and python Dependencies + command: | + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.11/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze + - run: + name: Determine Tests to Run (j11_dtests_offheap) + no_output_timeout: 5m + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.11/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_dtests_offheap)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --use-off-heap-memtables --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_dtests_offheap_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_dtests_offheap_raw /tmp/all_dtest_tests_j11_dtests_offheap\nelse\n grep -e '' /tmp/all_dtest_tests_j11_dtests_offheap_raw > /tmp/all_dtest_tests_j11_dtests_offheap || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_dtests_offheap > /tmp/split_dtest_tests_j11_dtests_offheap.txt\ncat /tmp/split_dtest_tests_j11_dtests_offheap.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\ncat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\n" + - run: + name: Run dtests (j11_dtests_offheap) + no_output_timeout: 15m + command: | + echo "cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt" + cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt + + source ~/env3.11/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + if [ -n 'CQLSH_PYTHON=/usr/bin/python3.11' ]; then + export CQLSH_PYTHON=/usr/bin/python3.11 + fi + + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest + + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt` if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j8_dtests_offheap.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_dtests_offheap.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt else echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" (exit 1) @@ -6027,10 +5414,10 @@ jobs: path: /tmp/results - store_artifacts: path: /tmp/dtest - destination: dtest_j8_dtests_offheap + destination: dtest_j11_dtests_offheap - store_artifacts: path: ~/cassandra-dtest/logs - destination: dtest_j8_dtests_offheap_logs + destination: dtest_j11_dtests_offheap_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -6046,7 +5433,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6058,31 +5445,46 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j8_utests_stress_repeat: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j11_utests_trie: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + 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: | @@ -6106,19 +5508,28 @@ jobs: which java java -version - run: - name: Repeatedly run new or modifed JUnit tests + name: Run Unit Tests (testclasslist-trie) + 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-trie -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -Dno-build-test=true no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_STRESS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_STRESS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS_STRESS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=stress-test-some\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant stress-test-some $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: - path: /tmp/results/repeated_utests/output - - store_artifacts: - path: /tmp/results/repeated_utests/stdout - destination: stdout + 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: - ANT_HOME: /usr/share/ant @@ -6135,7 +5546,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6147,28 +5558,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - 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_vnode_repeat: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j11_dtests_large_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -6192,25 +5599,25 @@ jobs: name: Run repeated Python DTests no_output_timeout: 15m command: | - if [ "${REPEATED_DTESTS}" == "" ]; then + if [ "${REPEATED_LARGE_DTESTS}" == "" ]; then echo "Repeated dtest name hasn't been defined, exiting without running any test" - elif [ "${REPEATED_DTESTS_COUNT}" == "" ]; then + elif [ "${REPEATED_LARGE_DTESTS_COUNT}" == "" ]; then echo "Repeated dtest count hasn't been defined, exiting without running any test" - elif [ "${REPEATED_DTESTS_COUNT}" -le 0 ]; then + elif [ "${REPEATED_LARGE_DTESTS_COUNT}" -le 0 ]; then echo "Repeated dtest count is lesser or equals than zero, exiting without running any test" else # Calculate the number of test iterations to be run by the current parallel runner. # Since we are running the same test multiple times there is no need to use `circleci tests split`. - count=$((${REPEATED_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) - if (($CIRCLE_NODE_INDEX < (${REPEATED_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then + count=$((${REPEATED_LARGE_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) + if (($CIRCLE_NODE_INDEX < (${REPEATED_LARGE_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then count=$((count+1)) fi if (($count <= 0)); then echo "No tests to run in this runner" else - echo "Running ${REPEATED_DTESTS} $count times" + echo "Running ${REPEATED_LARGE_DTESTS} $count times" source ~/env3.6/bin/activate export PATH=$JAVA_HOME/bin:$PATH @@ -6223,7 +5630,7 @@ jobs: echo "** done env" mkdir -p /tmp/results/dtests - tests_arg=$(echo ${REPEATED_DTESTS} | sed -e "s/,/ /g") + tests_arg=$(echo ${REPEATED_LARGE_DTESTS} | sed -e "s/,/ /g") stop_on_failure_arg="" if ${REPEATED_TESTS_STOP_ON_FAILURE}; then @@ -6231,7 +5638,7 @@ jobs: fi vnodes_args="" - if true; then + if false; then vnodes_args="--use-vnodes --num-tokens=16" fi @@ -6241,7 +5648,7 @@ jobs: fi # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $tests_arg | tee /tmp/dtest/stdout.txt + set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir --only-resource-intensive-tests --force-resource-intensive-tests $tests_arg | tee /tmp/dtest/stdout.txt fi fi - store_test_results: @@ -6267,7 +5674,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6279,87 +5686,64 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_cqlsh_dtests_py3_vnode: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j17_utests_compression_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra - run: - name: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies + name: Log Environment Information command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Determine Tests to Run (j11_with_vnodes) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_with_vnodes_raw /tmp/all_dtest_tests_j11_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_with_vnodes_raw > /tmp/all_dtest_tests_j11_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_with_vnodes > /tmp/split_dtest_tests_j11_with_vnodes.txt\ncat /tmp/split_dtest_tests_j11_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\n" + 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 dtests (j11_with_vnodes) + name: Repeatedly run new or modifed JUnit tests no_output_timeout: 15m - command: | - echo "cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt" - cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt - - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - if [ -n 'CQLSH_PYTHON=/usr/bin/python3.6' ]; then - export CQLSH_PYTHON=/usr/bin/python3.6 - fi - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt` - if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt - else - echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" - (exit 1) - fi + command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-compression\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-compression $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: - path: /tmp/results + path: /tmp/results/repeated_utests/output - store_artifacts: - path: /tmp/dtest - destination: dtest_j11_with_vnodes + path: /tmp/results/repeated_utests/stdout + destination: stdout - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_j11_with_vnodes_logs + path: /tmp/results/repeated_utests/output + destination: junitxml + - store_artifacts: + path: /tmp/results/repeated_utests/logs + destination: logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -6375,7 +5759,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6387,29 +5771,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_upgrade_dtests: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_cqlsh_dtests_py3_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -6430,127 +5809,45 @@ jobs: pip3 uninstall -y cqlsh pip3 freeze - run: - name: Determine Tests to Run (j8_upgradetests_without_vnodes) + name: Determine Tests to Run (j11_with_vnodes) no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j8_upgradetests_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --execute-upgrade-tests-only --upgrade-target-version-only --upgrade-version-selection all --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j8_upgradetests_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j8_upgradetests_without_vnodes_raw /tmp/all_dtest_tests_j8_upgradetests_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j8_upgradetests_without_vnodes_raw > /tmp/all_dtest_tests_j8_upgradetests_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j8_upgradetests_without_vnodes > /tmp/split_dtest_tests_j8_upgradetests_without_vnodes.txt\ncat /tmp/split_dtest_tests_j8_upgradetests_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j8_upgradetests_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j8_upgradetests_without_vnodes_final.txt\n" + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_with_vnodes_raw /tmp/all_dtest_tests_j11_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_with_vnodes_raw > /tmp/all_dtest_tests_j11_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_with_vnodes > /tmp/split_dtest_tests_j11_with_vnodes.txt\ncat /tmp/split_dtest_tests_j11_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\n" - run: - name: Run dtests (j8_upgradetests_without_vnodes) + name: Run dtests (j11_with_vnodes) no_output_timeout: 15m - command: "echo \"cat /tmp/split_dtest_tests_j8_upgradetests_without_vnodes_final.txt\"\ncat /tmp/split_dtest_tests_j8_upgradetests_without_vnodes_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j8_upgradetests_without_vnodes_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --execute-upgrade-tests-only --upgrade-target-version-only --upgrade-version-selection all --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j8_upgradetests_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" - - store_test_results: - path: /tmp/results - - store_artifacts: - path: /tmp/dtest - destination: dtest_j8_upgradetests_without_vnodes - - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_j8_upgradetests_without_vnodes_logs - environment: - - 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_FQLTOOL: null - - REPEATED_UTESTS_FQLTOOL_COUNT: 500 - - REPEATED_UTESTS_LONG: null - - REPEATED_UTESTS_LONG_COUNT: 100 - - REPEATED_UTESTS_STRESS: null - - REPEATED_UTESTS_STRESS_COUNT: 500 - - REPEATED_SIMULATOR_DTESTS: null - - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_dtests_offheap: - docker: - - image: apache/cassandra-testing-ubuntu2004-java11: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: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + echo "cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt" + cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt + source ~/env3.6/bin/activate export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Determine Tests to Run (j11_dtests_offheap) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_dtests_offheap)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --use-off-heap-memtables --skip-resource-intensive-tests --pytest-options '-k not cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_dtests_offheap_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_dtests_offheap_raw /tmp/all_dtest_tests_j11_dtests_offheap\nelse\n grep -e '' /tmp/all_dtest_tests_j11_dtests_offheap_raw > /tmp/all_dtest_tests_j11_dtests_offheap || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_dtests_offheap > /tmp/split_dtest_tests_j11_dtests_offheap.txt\ncat /tmp/split_dtest_tests_j11_dtests_offheap.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\ncat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\n" - - run: - name: Run dtests (j11_dtests_offheap) - no_output_timeout: 15m - command: "echo \"cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\"\ncat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j11_dtests_offheap.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" + if [ -n 'CQLSH_PYTHON=/usr/bin/python3.6' ]; then + export CQLSH_PYTHON=/usr/bin/python3.6 + fi + + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest + + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt` + if [ ! -z "$SPLIT_TESTS" ]; then + set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + else + echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" + (exit 1) + fi - store_test_results: path: /tmp/results - store_artifacts: path: /tmp/dtest - destination: dtest_j11_dtests_offheap + destination: dtest_j11_with_vnodes - store_artifacts: path: ~/cassandra-dtest/logs - destination: dtest_j11_dtests_offheap_logs + destination: dtest_j11_with_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -6566,7 +5863,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6578,14 +5875,10 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - REPEATED_UPGRADE_DTESTS: null - - REPEATED_UPGRADE_DTESTS_COUNT: 25 - REPEATED_ANT_TEST_TARGET: testsome - REPEATED_ANT_TEST_CLASS: null - REPEATED_ANT_TEST_METHODS: null @@ -6593,53 +5886,34 @@ jobs: - REPEATED_ANT_TEST_COUNT: 500 - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_jvm_upgrade_dtests_repeat: + j17_utests_fqltool: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 1 steps: - attach_workspace: at: /home/cassandra - run: - name: Log Environment Information + name: Run Unit Tests (fqltool-test) 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 + 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 fqltool-test -Dno-build-test=true no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_JVM_UPGRADE_DTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_JVM_UPGRADE_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_JVM_UPGRADE_DTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-jvm-dtest-some\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-jvm-dtest-some $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: - path: /tmp/results/repeated_utests/output - - store_artifacts: - path: /tmp/results/repeated_utests/stdout - destination: stdout + 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: - ANT_HOME: /usr/share/ant @@ -6656,7 +5930,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6668,25 +5942,21 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_cqlsh_dtests_py38_vnode: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_dtests_large_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: xlarge working_directory: ~/ shell: /bin/bash -eo pipefail -l parallelism: 4 @@ -6704,51 +5974,27 @@ jobs: # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.8/bin/activate + source ~/env3.6/bin/activate export PATH=$JAVA_HOME/bin:$PATH pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt pip3 uninstall -y cqlsh pip3 freeze - run: - name: Determine Tests to Run (j11_with_vnodes) + name: Determine Tests to Run (j17_large_with_vnodes) no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.8/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_with_vnodes_raw /tmp/all_dtest_tests_j11_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_with_vnodes_raw > /tmp/all_dtest_tests_j11_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_with_vnodes > /tmp/split_dtest_tests_j11_with_vnodes.txt\ncat /tmp/split_dtest_tests_j11_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\n" + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j17_large_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --only-resource-intensive-tests --force-resource-intensive-tests --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j17_large_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j17_large_with_vnodes_raw /tmp/all_dtest_tests_j17_large_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j17_large_with_vnodes_raw > /tmp/all_dtest_tests_j17_large_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j17_large_with_vnodes > /tmp/split_dtest_tests_j17_large_with_vnodes.txt\ncat /tmp/split_dtest_tests_j17_large_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j17_large_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j17_large_with_vnodes_final.txt\n" - run: - name: Run dtests (j11_with_vnodes) + name: Run dtests (j17_large_with_vnodes) no_output_timeout: 15m - command: | - echo "cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt" - cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt - - source ~/env3.8/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - if [ -n 'CQLSH_PYTHON=/usr/bin/python3.8' ]; then - export CQLSH_PYTHON=/usr/bin/python3.8 - fi - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt` - if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt - else - echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" - (exit 1) - fi + command: "echo \"cat /tmp/split_dtest_tests_j17_large_with_vnodes_final.txt\"\ncat /tmp/split_dtest_tests_j17_large_with_vnodes_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j17_large_with_vnodes_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --only-resource-intensive-tests --force-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j17_large_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" - store_test_results: path: /tmp/results - store_artifacts: path: /tmp/dtest - destination: dtest_j11_with_vnodes + destination: dtest_j17_large_with_vnodes - store_artifacts: path: ~/cassandra-dtest/logs - destination: dtest_j11_with_vnodes_logs + destination: dtest_j17_large_with_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -6764,7 +6010,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6776,69 +6022,59 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_utests_trie_repeat: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_dtests_offheap: docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra - run: - name: Log Environment Information + name: Clone Cassandra dtest Repository (via git) 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 + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - run: - name: Repeatedly run new or modifed JUnit tests + name: Configure virtualenv and python Dependencies + command: | + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.6/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze + - run: + name: Determine Tests to Run (j11_dtests_offheap) + no_output_timeout: 5m + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_dtests_offheap)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --use-off-heap-memtables --skip-resource-intensive-tests --pytest-options '-k not cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_dtests_offheap_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_dtests_offheap_raw /tmp/all_dtest_tests_j11_dtests_offheap\nelse\n grep -e '' /tmp/all_dtest_tests_j11_dtests_offheap_raw > /tmp/all_dtest_tests_j11_dtests_offheap || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_dtests_offheap > /tmp/split_dtest_tests_j11_dtests_offheap.txt\ncat /tmp/split_dtest_tests_j11_dtests_offheap.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\ncat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\n" + - run: + name: Run dtests (j11_dtests_offheap) no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-trie\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-trie $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" + command: "echo \"cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\"\ncat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_dtests_offheap_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j11_dtests_offheap.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" - store_test_results: - path: /tmp/results/repeated_utests/output - - store_artifacts: - path: /tmp/results/repeated_utests/stdout - destination: stdout + path: /tmp/results - store_artifacts: - path: /tmp/results/repeated_utests/output - destination: junitxml + path: /tmp/dtest + destination: dtest_j11_dtests_offheap - store_artifacts: - path: /tmp/results/repeated_utests/logs - destination: logs + path: ~/cassandra-dtest/logs + destination: dtest_j11_dtests_offheap_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -6854,7 +6090,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6866,14 +6102,10 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - REPEATED_UPGRADE_DTESTS: null - - REPEATED_UPGRADE_DTESTS_COUNT: 25 - REPEATED_ANT_TEST_TARGET: testsome - REPEATED_ANT_TEST_CLASS: null - REPEATED_ANT_TEST_METHODS: null @@ -6881,54 +6113,72 @@ jobs: - REPEATED_ANT_TEST_COUNT: 500 - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_simulator_dtests_repeat: + j11_cqlsh_dtests_py38_vnode: docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra - run: - name: Log Environment Information + name: Clone Cassandra dtest Repository (via git) 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 + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - run: - name: Repeatedly run new or modifed JUnit tests + name: Configure virtualenv and python Dependencies + command: | + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.8/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze + - run: + name: Determine Tests to Run (j11_with_vnodes) + no_output_timeout: 5m + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.8/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_with_vnodes_raw /tmp/all_dtest_tests_j11_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_with_vnodes_raw > /tmp/all_dtest_tests_j11_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_with_vnodes > /tmp/split_dtest_tests_j11_with_vnodes.txt\ncat /tmp/split_dtest_tests_j11_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\n" + - run: + name: Run dtests (j11_with_vnodes) no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_SIMULATOR_DTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_SIMULATOR_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_SIMULATOR_DTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-simulator-dtest\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-simulator-dtest $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" + command: | + echo "cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt" + cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt + + source ~/env3.8/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + if [ -n 'CQLSH_PYTHON=/usr/bin/python3.8' ]; then + export CQLSH_PYTHON=/usr/bin/python3.8 + fi + + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest + + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt` + if [ ! -z "$SPLIT_TESTS" ]; then + set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + else + echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" + (exit 1) + fi - store_test_results: - path: /tmp/results/repeated_utests/output - - store_artifacts: - path: /tmp/results/repeated_utests/stdout - destination: stdout + path: /tmp/results - store_artifacts: - path: /tmp/results/repeated_utests/output - destination: junitxml + path: /tmp/dtest + destination: dtest_j11_with_vnodes - store_artifacts: - path: /tmp/results/repeated_utests/logs - destination: logs + path: ~/cassandra-dtest/logs + destination: dtest_j11_with_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -6944,7 +6194,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6956,14 +6206,10 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - REPEATED_UPGRADE_DTESTS: null - - REPEATED_UPGRADE_DTESTS_COUNT: 25 - REPEATED_ANT_TEST_TARGET: testsome - REPEATED_ANT_TEST_CLASS: null - REPEATED_ANT_TEST_METHODS: null @@ -6971,14 +6217,13 @@ jobs: - REPEATED_ANT_TEST_COUNT: 500 - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_jvm_dtests_repeat: + j11_utests_trie_repeat: docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -7007,7 +6252,7 @@ jobs: - run: name: Repeatedly run new or modifed JUnit tests no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_JVM_DTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_JVM_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_JVM_DTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-jvm-dtest-some\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-jvm-dtest-some $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" + command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-trie\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-trie $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: path: /tmp/results/repeated_utests/output - store_artifacts: @@ -7034,7 +6279,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7046,14 +6291,10 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - REPEATED_UPGRADE_DTESTS: null - - REPEATED_UPGRADE_DTESTS_COUNT: 25 - REPEATED_ANT_TEST_TARGET: testsome - REPEATED_ANT_TEST_CLASS: null - REPEATED_ANT_TEST_METHODS: null @@ -7061,73 +6302,53 @@ jobs: - REPEATED_ANT_TEST_COUNT: 500 - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_cqlsh_dtests_py311_vnode: + j11_simulator_dtests_repeat: docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra - run: - name: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies + name: Log Environment Information command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.11/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Determine Tests to Run (j11_with_vnodes) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.11/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_with_vnodes_raw /tmp/all_dtest_tests_j11_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_with_vnodes_raw > /tmp/all_dtest_tests_j11_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_with_vnodes > /tmp/split_dtest_tests_j11_with_vnodes.txt\ncat /tmp/split_dtest_tests_j11_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\n" + 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 dtests (j11_with_vnodes) + name: Repeatedly run new or modifed JUnit tests no_output_timeout: 15m - command: | - echo "cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt" - cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt - - source ~/env3.11/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - if [ -n 'CQLSH_PYTHON=/usr/bin/python3.11' ]; then - export CQLSH_PYTHON=/usr/bin/python3.11 - fi - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt` - if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt - else - echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" - (exit 1) - fi + command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_SIMULATOR_DTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_SIMULATOR_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_SIMULATOR_DTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-simulator-dtest\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-simulator-dtest $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: - path: /tmp/results + path: /tmp/results/repeated_utests/output - store_artifacts: - path: /tmp/dtest - destination: dtest_j11_with_vnodes + path: /tmp/results/repeated_utests/stdout + destination: stdout - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_j11_with_vnodes_logs + path: /tmp/results/repeated_utests/output + destination: junitxml + - store_artifacts: + path: /tmp/results/repeated_utests/logs + destination: logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -7143,7 +6364,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7155,14 +6376,10 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - REPEATED_UPGRADE_DTESTS: null - - REPEATED_UPGRADE_DTESTS_COUNT: 25 - REPEATED_ANT_TEST_TARGET: testsome - REPEATED_ANT_TEST_CLASS: null - REPEATED_ANT_TEST_METHODS: null @@ -7170,14 +6387,13 @@ jobs: - REPEATED_ANT_TEST_COUNT: 500 - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_utests_long_repeat: + j11_jvm_dtests_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -7206,7 +6422,7 @@ jobs: - run: name: Repeatedly run new or modifed JUnit tests no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_LONG_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_LONG_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS_LONG} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=long-testsome\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant long-testsome $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" + command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_JVM_DTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_JVM_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_JVM_DTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-jvm-dtest-some\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-jvm-dtest-some $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: path: /tmp/results/repeated_utests/output - store_artifacts: @@ -7233,7 +6449,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7245,28 +6461,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - 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_offheap: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j17_cqlsh_dtests_py38_offheap: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -7281,27 +6493,51 @@ jobs: # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.6/bin/activate + source ~/env3.8/bin/activate export PATH=$JAVA_HOME/bin:$PATH pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt pip3 uninstall -y cqlsh pip3 freeze - run: - name: Determine Tests to Run (j8_dtests_offheap) + name: Determine Tests to Run (j17_dtests_offheap) no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j8_dtests_offheap)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --use-off-heap-memtables --skip-resource-intensive-tests --pytest-options '-k not cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j8_dtests_offheap_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j8_dtests_offheap_raw /tmp/all_dtest_tests_j8_dtests_offheap\nelse\n grep -e '' /tmp/all_dtest_tests_j8_dtests_offheap_raw > /tmp/all_dtest_tests_j8_dtests_offheap || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j8_dtests_offheap > /tmp/split_dtest_tests_j8_dtests_offheap.txt\ncat /tmp/split_dtest_tests_j8_dtests_offheap.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j8_dtests_offheap_final.txt\ncat /tmp/split_dtest_tests_j8_dtests_offheap_final.txt\n" + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.8/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j17_dtests_offheap)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --use-off-heap-memtables --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j17_dtests_offheap_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j17_dtests_offheap_raw /tmp/all_dtest_tests_j17_dtests_offheap\nelse\n grep -e '' /tmp/all_dtest_tests_j17_dtests_offheap_raw > /tmp/all_dtest_tests_j17_dtests_offheap || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j17_dtests_offheap > /tmp/split_dtest_tests_j17_dtests_offheap.txt\ncat /tmp/split_dtest_tests_j17_dtests_offheap.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j17_dtests_offheap_final.txt\ncat /tmp/split_dtest_tests_j17_dtests_offheap_final.txt\n" - run: - name: Run dtests (j8_dtests_offheap) + name: Run dtests (j17_dtests_offheap) no_output_timeout: 15m - command: "echo \"cat /tmp/split_dtest_tests_j8_dtests_offheap_final.txt\"\ncat /tmp/split_dtest_tests_j8_dtests_offheap_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j8_dtests_offheap_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j8_dtests_offheap.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" + command: | + echo "cat /tmp/split_dtest_tests_j17_dtests_offheap_final.txt" + cat /tmp/split_dtest_tests_j17_dtests_offheap_final.txt + + source ~/env3.8/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + if [ -n 'CQLSH_PYTHON=/usr/bin/python3.8' ]; then + export CQLSH_PYTHON=/usr/bin/python3.8 + fi + + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest + + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j17_dtests_offheap_final.txt` + if [ ! -z "$SPLIT_TESTS" ]; then + set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j17_dtests_offheap.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + else + echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" + (exit 1) + fi - store_test_results: path: /tmp/results - store_artifacts: path: /tmp/dtest - destination: dtest_j8_dtests_offheap + destination: dtest_j17_dtests_offheap - store_artifacts: path: ~/cassandra-dtest/logs - destination: dtest_j8_dtests_offheap_logs + destination: dtest_j17_dtests_offheap_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -7317,7 +6553,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7329,96 +6565,37 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - 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: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_cqlshlib_tests: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 1 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 cqlshlib Unit Tests 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 -Dno-build-test=true + cd /tmp/cassandra/ + ./pylib/cassandra-cqlsh-tests.sh $(pwd) 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 + path: /tmp/cassandra/pylib environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -7434,7 +6611,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7446,96 +6623,83 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_jvm_dtests: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_cqlsh_dtests_py311_vnode: docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra - run: - name: Determine distributed Tests to Run + name: Clone Cassandra dtest Repository (via git) 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/distributed/**/*.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/distributed/;;g" | grep "Test\.java$" | grep -v upgrade > /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 + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - run: - name: Log Environment Information + name: Configure virtualenv and python Dependencies 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 + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.11/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze - run: - name: Run Unit Tests (testclasslist) + name: Determine Tests to Run (j11_with_vnodes) + no_output_timeout: 5m + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.11/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_with_vnodes_raw /tmp/all_dtest_tests_j11_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_with_vnodes_raw > /tmp/all_dtest_tests_j11_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_with_vnodes > /tmp/split_dtest_tests_j11_with_vnodes.txt\ncat /tmp/split_dtest_tests_j11_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\n" + - run: + name: Run dtests (j11_with_vnodes) + no_output_timeout: 15m command: | - set -x + echo "cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt" + cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt + + source ~/env3.11/bin/activate 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.distributed.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}') + if [ -n 'CQLSH_PYTHON=/usr/bin/python3.11' ]; then + export CQLSH_PYTHON=/usr/bin/python3.11 + fi + + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest + + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt` + if [ ! -z "$SPLIT_TESTS" ]; then + set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j11_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + else + echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" + (exit 1) fi - ant testclasslist -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=distributed -Dno-build-test=true - no_output_timeout: 15m - store_test_results: - path: /tmp/cassandra/build/test/output/ + path: /tmp/results - store_artifacts: - path: /tmp/cassandra/build/test/output - destination: junitxml + path: /tmp/dtest + destination: dtest_j11_with_vnodes - store_artifacts: - path: /tmp/cassandra/build/test/logs - destination: logs + path: ~/cassandra-dtest/logs + destination: dtest_j11_with_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -7551,7 +6715,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7563,14 +6727,10 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - REPEATED_UPGRADE_DTESTS: null - - REPEATED_UPGRADE_DTESTS_COUNT: 25 - REPEATED_ANT_TEST_TARGET: testsome - REPEATED_ANT_TEST_CLASS: null - REPEATED_ANT_TEST_METHODS: null @@ -7578,17 +6738,35 @@ jobs: - REPEATED_ANT_TEST_COUNT: 500 - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_jvm_dtests_vnode_repeat: + j17_utests_system_keyspace_directory: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + 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: | @@ -7612,19 +6790,28 @@ jobs: which java java -version - run: - name: Repeatedly run new or modifed JUnit tests + name: Run Unit Tests (testclasslist-system-keyspace-directory) + 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-system-keyspace-directory -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -Dno-build-test=true no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_JVM_DTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_JVM_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_JVM_DTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=true\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-jvm-dtest-some\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-jvm-dtest-some $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: - path: /tmp/results/repeated_utests/output - - store_artifacts: - path: /tmp/results/repeated_utests/stdout - destination: stdout + 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: - ANT_HOME: /usr/share/ant @@ -7641,7 +6828,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7653,86 +6840,83 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j11_build: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_cqlsh_dtests_py3_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 50 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: Clone Cassandra Repository (via git) + name: Clone Cassandra dtest Repository (via git) command: | - git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH https://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git ~/cassandra + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - run: - name: Build Cassandra + name: Configure virtualenv and python Dependencies command: | + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.6/bin/activate export PATH=$JAVA_HOME/bin:$PATH - cd ~/cassandra - # Loop to prevent failure due to maven-ant-tasks not downloading a jar.. - for x in $(seq 1 3); do - ${ANT_HOME}/bin/ant clean realclean jar - RETURN="$?" - if [ "${RETURN}" -eq "0" ]; then - break - fi - done - # Exit, if we didn't build successfully - if [ "${RETURN}" -ne "0" ]; then - echo "Build failed with exit code: ${RETURN}" - exit ${RETURN} - fi - no_output_timeout: 15m + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze - run: - name: Run eclipse-warnings + name: Determine Tests to Run (j17_with_vnodes) + no_output_timeout: 5m + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j17_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j17_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j17_with_vnodes_raw /tmp/all_dtest_tests_j17_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j17_with_vnodes_raw > /tmp/all_dtest_tests_j17_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j17_with_vnodes > /tmp/split_dtest_tests_j17_with_vnodes.txt\ncat /tmp/split_dtest_tests_j17_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j17_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j17_with_vnodes_final.txt\n" + - run: + name: Run dtests (j17_with_vnodes) + no_output_timeout: 15m command: | + echo "cat /tmp/split_dtest_tests_j17_with_vnodes_final.txt" + cat /tmp/split_dtest_tests_j17_with_vnodes_final.txt + + source ~/env3.6/bin/activate export PATH=$JAVA_HOME/bin:$PATH - cd ~/cassandra - ant eclipse-warnings - - persist_to_workspace: - root: /home/cassandra - paths: - - cassandra - - .m2 + if [ -n 'CQLSH_PYTHON=/usr/bin/python3.6' ]; then + export CQLSH_PYTHON=/usr/bin/python3.6 + fi + + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest + + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j17_with_vnodes_final.txt` + if [ ! -z "$SPLIT_TESTS" ]; then + set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j17_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + else + echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" + (exit 1) + fi + - store_test_results: + path: /tmp/results + - store_artifacts: + path: /tmp/dtest + destination: dtest_j17_with_vnodes + - store_artifacts: + path: ~/cassandra-dtest/logs + destination: dtest_j17_with_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -7748,7 +6932,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7760,29 +6944,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_dtests: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_cqlsh_dtests_py311_vnode: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -7797,27 +6976,51 @@ jobs: # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.6/bin/activate + source ~/env3.11/bin/activate export PATH=$JAVA_HOME/bin:$PATH pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt pip3 uninstall -y cqlsh pip3 freeze - run: - name: Determine Tests to Run (j8_without_vnodes) + name: Determine Tests to Run (j17_with_vnodes) no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j8_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --skip-resource-intensive-tests --pytest-options '-k not cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j8_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j8_without_vnodes_raw /tmp/all_dtest_tests_j8_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j8_without_vnodes_raw > /tmp/all_dtest_tests_j8_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j8_without_vnodes > /tmp/split_dtest_tests_j8_without_vnodes.txt\ncat /tmp/split_dtest_tests_j8_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j8_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j8_without_vnodes_final.txt\n" + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.11/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j17_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j17_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j17_with_vnodes_raw /tmp/all_dtest_tests_j17_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j17_with_vnodes_raw > /tmp/all_dtest_tests_j17_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j17_with_vnodes > /tmp/split_dtest_tests_j17_with_vnodes.txt\ncat /tmp/split_dtest_tests_j17_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j17_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j17_with_vnodes_final.txt\n" - run: - name: Run dtests (j8_without_vnodes) + name: Run dtests (j17_with_vnodes) no_output_timeout: 15m - command: "echo \"cat /tmp/split_dtest_tests_j8_without_vnodes_final.txt\"\ncat /tmp/split_dtest_tests_j8_without_vnodes_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j8_without_vnodes_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --skip-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j8_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" + command: | + echo "cat /tmp/split_dtest_tests_j17_with_vnodes_final.txt" + cat /tmp/split_dtest_tests_j17_with_vnodes_final.txt + + source ~/env3.11/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + if [ -n 'CQLSH_PYTHON=/usr/bin/python3.11' ]; then + export CQLSH_PYTHON=/usr/bin/python3.11 + fi + + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest + + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j17_with_vnodes_final.txt` + if [ ! -z "$SPLIT_TESTS" ]; then + set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j17_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + else + echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" + (exit 1) + fi - store_test_results: path: /tmp/results - store_artifacts: path: /tmp/dtest - destination: dtest_j8_without_vnodes + destination: dtest_j17_with_vnodes - store_artifacts: path: ~/cassandra-dtest/logs - destination: dtest_j8_without_vnodes_logs + destination: dtest_j17_with_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -7833,7 +7036,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7845,63 +7048,92 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - 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_vnode: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_jvm_dtests: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 10 steps: - attach_workspace: at: /home/cassandra - run: - name: Clone Cassandra dtest Repository (via git) + name: Determine distributed Tests to Run command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest + # 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/distributed/**/*.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/distributed/;;g" | grep "Test\.java$" | grep -v upgrade > /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: Configure virtualenv and python Dependencies + name: Log Environment Information command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Determine Tests to Run (j8_with_vnodes) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j8_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --skip-resource-intensive-tests --pytest-options '-k not cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j8_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j8_with_vnodes_raw /tmp/all_dtest_tests_j8_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j8_with_vnodes_raw > /tmp/all_dtest_tests_j8_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j8_with_vnodes > /tmp/split_dtest_tests_j8_with_vnodes.txt\ncat /tmp/split_dtest_tests_j8_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j8_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j8_with_vnodes_final.txt\n" + 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 dtests (j8_with_vnodes) + name: Run Unit Tests (testclasslist) + 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.distributed.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=distributed -Dno-build-test=true no_output_timeout: 15m - command: "echo \"cat /tmp/split_dtest_tests_j8_with_vnodes_final.txt\"\ncat /tmp/split_dtest_tests_j8_with_vnodes_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j8_with_vnodes_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --skip-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j8_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" - store_test_results: - path: /tmp/results + path: /tmp/cassandra/build/test/output/ - store_artifacts: - path: /tmp/dtest - destination: dtest_j8_with_vnodes + path: /tmp/cassandra/build/test/output + destination: junitxml - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_j8_with_vnodes_logs + path: /tmp/cassandra/build/test/logs + destination: logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -7917,7 +7149,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7929,22 +7161,18 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_cqlshlib_tests: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j17_utests_stress: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium @@ -7955,15 +7183,24 @@ jobs: - attach_workspace: at: /home/cassandra - run: - name: Run cqlshlib Unit Tests + name: Run Unit Tests (stress-test) command: | export PATH=$JAVA_HOME/bin:$PATH time mv ~/cassandra /tmp - cd /tmp/cassandra/ - ./pylib/cassandra-cqlsh-tests.sh $(pwd) + cd /tmp/cassandra + if [ -d ~/dtest_jars ]; then + cp ~/dtest_jars/dtest* /tmp/cassandra/build/ + fi + ant stress-test -Dno-build-test=true no_output_timeout: 15m - store_test_results: - path: /tmp/cassandra/pylib + 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: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -7979,7 +7216,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7991,29 +7228,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_jvm_dtests_repeat: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_jvm_dtests_vnode_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -8042,7 +7274,7 @@ jobs: - run: name: Repeatedly run new or modifed JUnit tests no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_JVM_DTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_JVM_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_JVM_DTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-jvm-dtest-some\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-jvm-dtest-some $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" + command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_JVM_DTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_JVM_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_JVM_DTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=true\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-jvm-dtest-some\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-jvm-dtest-some $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: path: /tmp/results/repeated_utests/output - store_artifacts: @@ -8069,7 +7301,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8081,31 +7313,25 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_dtests: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j11_build: docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 1 steps: - - attach_workspace: - at: /home/cassandra - run: name: Log Environment Information command: | @@ -8129,37 +7355,39 @@ jobs: which java java -version - run: - name: Clone Cassandra dtest Repository (via git) + name: Clone Cassandra Repository (via git) command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest + git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH https://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git ~/cassandra - run: - name: Configure virtualenv and python Dependencies + name: Build Cassandra command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.6/bin/activate export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Determine Tests to Run (j11_without_vnodes) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --skip-resource-intensive-tests --pytest-options '-k not cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_without_vnodes_raw /tmp/all_dtest_tests_j11_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_without_vnodes_raw > /tmp/all_dtest_tests_j11_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_without_vnodes > /tmp/split_dtest_tests_j11_without_vnodes.txt\ncat /tmp/split_dtest_tests_j11_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_without_vnodes_final.txt\n" - - run: - name: Run dtests (j11_without_vnodes) + cd ~/cassandra + # Loop to prevent failure due to maven-ant-tasks not downloading a jar.. + for x in $(seq 1 3); do + ${ANT_HOME}/bin/ant clean realclean jar + RETURN="$?" + if [ "${RETURN}" -eq "0" ]; then + break + fi + done + # Exit, if we didn't build successfully + if [ "${RETURN}" -ne "0" ]; then + echo "Build failed with exit code: ${RETURN}" + exit ${RETURN} + fi no_output_timeout: 15m - command: "echo \"cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt\"\ncat /tmp/split_dtest_tests_j11_without_vnodes_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --skip-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j11_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" - - store_test_results: - path: /tmp/results - - store_artifacts: - path: /tmp/dtest - destination: dtest_j11_without_vnodes - - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_j11_without_vnodes_logs + - run: + name: Run eclipse-warnings + command: | + export PATH=$JAVA_HOME/bin:$PATH + cd ~/cassandra + ant eclipse-warnings + - persist_to_workspace: + root: /home/cassandra + paths: + - cassandra + - .m2 environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -8175,7 +7403,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8187,174 +7415,37 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_repeated_ant_test: - 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: Run repeated JUnit test - no_output_timeout: 15m - command: | - if [ "${REPEATED_ANT_TEST_CLASS}" == "" ]; then - echo "Repeated utest class name hasn't been defined, exiting without running any test" - elif [ "${REPEATED_ANT_TEST_COUNT}" == "" ]; then - echo "Repeated utest count hasn't been defined, exiting without running any test" - elif [ "${REPEATED_ANT_TEST_COUNT}" -le 0 ]; then - echo "Repeated utest count is lesser or equals than zero, exiting without running any test" - else - - # Calculate the number of test iterations to be run by the current parallel runner. - # Since we are running the same test multiple times there is no need to use `circleci tests split`. - count=$((${REPEATED_ANT_TEST_COUNT} / CIRCLE_NODE_TOTAL)) - if (($CIRCLE_NODE_INDEX < (${REPEATED_ANT_TEST_COUNT} % CIRCLE_NODE_TOTAL))); then - count=$((count+1)) - fi - - if (($count <= 0)); then - echo "No tests to run in this runner" - else - echo "Running ${REPEATED_ANT_TEST_TARGET} ${REPEATED_ANT_TEST_CLASS} ${REPEATED_ANT_TEST_METHODS} ${REPEATED_ANT_TEST_COUNT} times" - - 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 - - target=${REPEATED_ANT_TEST_TARGET} - class_path=${REPEATED_ANT_TEST_CLASS} - class_name="${class_path##*.}" - - # 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-trie" || \ - $target == "test-system-keyspace-directory" || \ - $target == "fqltool-test" || \ - $target == "long-test" || \ - $target == "stress-test" || \ - $target == "test-simulator-dtest" ]]; then - name="-Dtest.name=$class_name" - else - name="-Dtest.name=$class_path" - fi - - # Prepare the -Dtest.methods argument, which is optional - if [ "${REPEATED_ANT_TEST_METHODS}" == "" ]; then - methods="" - else - methods="-Dtest.methods=${REPEATED_ANT_TEST_METHODS}" - fi - - # Prepare the JVM dtests vnodes argument, which is optional - vnodes_args="" - if ${REPEATED_ANT_TEST_VNODES}; then - vnodes_args="-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'" - fi - - # Run the test target as many times as requested collecting the exit code, - # stopping the iteration only if stop_on_failure is set. - exit_code="$?" - for i in $(seq -w 1 $count); do - - echo "Running test iteration $i of $count" - - # run the test - status="passes" - if !( set -o pipefail && ant $target $name $methods $vnodes_args -Dno-build-test=true | tee stdout.txt ); then - status="fails" - exit_code=1 - fi - - # move the stdout output file - dest=/tmp/results/repeated_utest/stdout/${status}/${i} - mkdir -p $dest - mv stdout.txt $dest/${REPEATED_ANT_TEST_TARGET}-${REPEATED_ANT_TEST_CLASS}.txt - - # move the XML output files - source=build/test/output - dest=/tmp/results/repeated_utest/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 - dest=/tmp/results/repeated_utest/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 - - (exit ${exit_code}) - fi - fi + - REPEATED_LARGE_DTESTS: null + - REPEATED_LARGE_DTESTS_COUNT: 100 + - REPEATED_ANT_TEST_TARGET: testsome + - REPEATED_ANT_TEST_CLASS: null + - REPEATED_ANT_TEST_METHODS: null + - REPEATED_ANT_TEST_VNODES: false + - REPEATED_ANT_TEST_COUNT: 500 + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j11_cqlshlib_tests: + 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 cqlshlib Unit Tests + command: | + export PATH=$JAVA_HOME/bin:$PATH + time mv ~/cassandra /tmp + cd /tmp/cassandra/ + ./pylib/cassandra-cqlsh-tests.sh $(pwd) + no_output_timeout: 15m - store_test_results: - path: /tmp/results/repeated_utest/output - - store_artifacts: - path: /tmp/results/repeated_utest/stdout - destination: stdout - - store_artifacts: - path: /tmp/results/repeated_utest/output - destination: junitxml - - store_artifacts: - path: /tmp/results/repeated_utest/logs - destination: logs + path: /tmp/cassandra/pylib environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -8370,7 +7461,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8382,50 +7473,59 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j8_utests_long: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j11_dtests: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra - run: - name: Run Unit Tests (long-test) + name: Clone Cassandra dtest Repository (via git) + command: | + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest + - run: + name: Configure virtualenv and python Dependencies command: | + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.6/bin/activate 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 long-test -Dno-build-test=true + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze + - run: + name: Determine Tests to Run (j11_without_vnodes) + no_output_timeout: 5m + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --skip-resource-intensive-tests --pytest-options '-k not cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_without_vnodes_raw /tmp/all_dtest_tests_j11_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_without_vnodes_raw > /tmp/all_dtest_tests_j11_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_without_vnodes > /tmp/split_dtest_tests_j11_without_vnodes.txt\ncat /tmp/split_dtest_tests_j11_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_without_vnodes_final.txt\n" + - run: + name: Run dtests (j11_without_vnodes) no_output_timeout: 15m + command: "echo \"cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt\"\ncat /tmp/split_dtest_tests_j11_without_vnodes_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_without_vnodes_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --skip-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j11_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" - store_test_results: - path: /tmp/cassandra/build/test/output/ + path: /tmp/results - store_artifacts: - path: /tmp/cassandra/build/test/output - destination: junitxml + path: /tmp/dtest + destination: dtest_j11_without_vnodes - store_artifacts: - path: /tmp/cassandra/build/test/logs - destination: logs + path: ~/cassandra-dtest/logs + destination: dtest_j11_without_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -8441,7 +7541,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8453,33 +7553,29 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j8_utests_cdc: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j17_jvm_dtests_vnode: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 10 steps: - attach_workspace: at: /home/cassandra - run: - name: Determine unit Tests to Run + name: Determine distributed 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 @@ -8489,11 +7585,11 @@ jobs: 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 + set -eo pipefail && circleci tests glob "$HOME/cassandra/test/distributed/**/*.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 + set -eo pipefail && cat /tmp/java_tests_${CIRCLE_NODE_INDEX}.txt | sed "s;^/home/cassandra/cassandra/test/distributed/;;g" | grep "Test\.java$" | grep -v upgrade > /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 @@ -8520,7 +7616,7 @@ jobs: which java java -version - run: - name: Run Unit Tests (testclasslist-cdc) + name: Run Unit Tests (testclasslist) command: | set -x export PATH=$JAVA_HOME/bin:$PATH @@ -8529,11 +7625,11 @@ jobs: 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) + test_timeout=$(grep 'name="test.distributed.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 -Dno-build-test=true + ant testclasslist -Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16' -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=distributed -Dno-build-test=true no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -8558,115 +7654,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null - - REPEATED_UTESTS_COUNT: 500 - - REPEATED_UTESTS_FQLTOOL: null - - REPEATED_UTESTS_FQLTOOL_COUNT: 500 - - REPEATED_UTESTS_LONG: null - - REPEATED_UTESTS_LONG_COUNT: 100 - - REPEATED_UTESTS_STRESS: null - - REPEATED_UTESTS_STRESS_COUNT: 500 - - REPEATED_SIMULATOR_DTESTS: null - - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j8_cqlsh_dtests_py311_offheap: - 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: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies - command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.11/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Determine Tests to Run (j8_dtests_offheap) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.11/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j8_dtests_offheap)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --use-off-heap-memtables --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j8_dtests_offheap_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j8_dtests_offheap_raw /tmp/all_dtest_tests_j8_dtests_offheap\nelse\n grep -e '' /tmp/all_dtest_tests_j8_dtests_offheap_raw > /tmp/all_dtest_tests_j8_dtests_offheap || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j8_dtests_offheap > /tmp/split_dtest_tests_j8_dtests_offheap.txt\ncat /tmp/split_dtest_tests_j8_dtests_offheap.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j8_dtests_offheap_final.txt\ncat /tmp/split_dtest_tests_j8_dtests_offheap_final.txt\n" - - run: - name: Run dtests (j8_dtests_offheap) - no_output_timeout: 15m - command: | - echo "cat /tmp/split_dtest_tests_j8_dtests_offheap_final.txt" - cat /tmp/split_dtest_tests_j8_dtests_offheap_final.txt - - source ~/env3.11/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - if [ -n 'CQLSH_PYTHON=/usr/bin/python3.11' ]; then - export CQLSH_PYTHON=/usr/bin/python3.11 - fi - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j8_dtests_offheap_final.txt` - if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j8_dtests_offheap.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt - else - echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" - (exit 1) - fi - - store_test_results: - path: /tmp/results - - store_artifacts: - path: /tmp/dtest - destination: dtest_j8_dtests_offheap - - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_j8_dtests_offheap_logs - environment: - - 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: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8678,111 +7666,83 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - - 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_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: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies - command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Run repeated Python DTests - no_output_timeout: 15m - command: | - if [ "${REPEATED_DTESTS}" == "" ]; then - echo "Repeated dtest name hasn't been defined, exiting without running any test" - elif [ "${REPEATED_DTESTS_COUNT}" == "" ]; then - echo "Repeated dtest count hasn't been defined, exiting without running any test" - elif [ "${REPEATED_DTESTS_COUNT}" -le 0 ]; then - echo "Repeated dtest count is lesser or equals than zero, exiting without running any test" - else - - # Calculate the number of test iterations to be run by the current parallel runner. - # Since we are running the same test multiple times there is no need to use `circleci tests split`. - count=$((${REPEATED_DTESTS_COUNT} / CIRCLE_NODE_TOTAL)) - if (($CIRCLE_NODE_INDEX < (${REPEATED_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then - count=$((count+1)) - fi - - if (($count <= 0)); then - echo "No tests to run in this runner" - else - echo "Running ${REPEATED_DTESTS} $count times" - - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - - tests_arg=$(echo ${REPEATED_DTESTS} | sed -e "s/,/ /g") - - stop_on_failure_arg="" - if ${REPEATED_TESTS_STOP_ON_FAILURE}; then - stop_on_failure_arg="-x" - fi + - REPEATED_ANT_TEST_COUNT: 500 + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_cqlsh_dtests_py38: + docker: + - image: apache/cassandra-testing-ubuntu2004-java11:latest + resource_class: large + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 50 + steps: + - attach_workspace: + at: /home/cassandra + - run: + name: Clone Cassandra dtest Repository (via git) + command: | + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest + - run: + name: Configure virtualenv and python Dependencies + command: | + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.8/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze + - run: + name: Determine Tests to Run (j17_without_vnodes) + no_output_timeout: 5m + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.8/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j17_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j17_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j17_without_vnodes_raw /tmp/all_dtest_tests_j17_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j17_without_vnodes_raw > /tmp/all_dtest_tests_j17_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j17_without_vnodes > /tmp/split_dtest_tests_j17_without_vnodes.txt\ncat /tmp/split_dtest_tests_j17_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j17_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j17_without_vnodes_final.txt\n" + - run: + name: Run dtests (j17_without_vnodes) + no_output_timeout: 15m + command: | + echo "cat /tmp/split_dtest_tests_j17_without_vnodes_final.txt" + cat /tmp/split_dtest_tests_j17_without_vnodes_final.txt - vnodes_args="" - if false; then - vnodes_args="--use-vnodes --num-tokens=16" - fi + source ~/env3.8/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + if [ -n 'CQLSH_PYTHON=/usr/bin/python3.8' ]; then + export CQLSH_PYTHON=/usr/bin/python3.8 + fi - upgrade_arg="" - if false; then - upgrade_arg="--execute-upgrade-tests --upgrade-target-version-only --upgrade-version-selection all" - fi + java -version + cd ~/cassandra-dtest + mkdir -p /tmp/dtest - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - set -o pipefail && cd ~/cassandra-dtest && pytest $vnodes_args --count=$count $stop_on_failure_arg $upgrade_arg --log-cli-level=DEBUG --junit-xml=/tmp/results/dtests/pytest_result.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $tests_arg | tee /tmp/dtest/stdout.txt - fi + echo "env: $(env)" + echo "** done env" + mkdir -p /tmp/results/dtests + # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee + export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j17_without_vnodes_final.txt` + if [ ! -z "$SPLIT_TESTS" ]; then + set -o pipefail && cd ~/cassandra-dtest && pytest --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j17_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt + else + echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" + (exit 1) fi - store_test_results: path: /tmp/results - store_artifacts: path: /tmp/dtest - destination: dtest + destination: dtest_j17_without_vnodes - store_artifacts: path: ~/cassandra-dtest/logs - destination: dtest_logs + destination: dtest_j17_without_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -8798,7 +7758,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8810,33 +7770,29 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - 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: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_utests_cdc: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra - run: - name: Determine distributed Tests to 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 @@ -8846,11 +7802,11 @@ jobs: echo "***java tests***" # get all of our unit test filenames - set -eo pipefail && circleci tests glob "$HOME/cassandra/test/distributed/**/*.java" > /tmp/all_java_unit_tests.txt + 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/distributed/;;g" | grep "Test\.java$" | grep -v upgrade > /tmp/java_tests_${CIRCLE_NODE_INDEX}_final.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 @@ -8877,7 +7833,7 @@ jobs: 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 @@ -8886,11 +7842,11 @@ jobs: if [ -d ~/dtest_jars ]; then cp ~/dtest_jars/dtest* /tmp/cassandra/build/ fi - test_timeout=$(grep 'name="test.distributed.timeout"' build.xml | awk -F'"' '{print $4}' || true) + 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=distributed -Dno-build-test=true + ant testclasslist-cdc -Dtest.timeout="$test_timeout" -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -Dno-build-test=true no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -8915,7 +7871,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8927,29 +7883,27 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j8_build: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_utests_fqltool_repeat: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + - image: apache/cassandra-testing-ubuntu2004-java11: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: | @@ -8973,39 +7927,20 @@ jobs: which java java -version - run: - name: Clone Cassandra Repository (via git) - command: | - git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH https://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git ~/cassandra - - run: - name: Build Cassandra - command: | - export PATH=$JAVA_HOME/bin:$PATH - cd ~/cassandra - # Loop to prevent failure due to maven-ant-tasks not downloading a jar.. - for x in $(seq 1 3); do - ${ANT_HOME}/bin/ant clean realclean jar - RETURN="$?" - if [ "${RETURN}" -eq "0" ]; then - break - fi - done - # Exit, if we didn't build successfully - if [ "${RETURN}" -ne "0" ]; then - echo "Build failed with exit code: ${RETURN}" - exit ${RETURN} - fi + name: Repeatedly run new or modifed JUnit tests no_output_timeout: 15m - - run: - name: Run eclipse-warnings - command: | - export PATH=$JAVA_HOME/bin:$PATH - cd ~/cassandra - ant eclipse-warnings - - persist_to_workspace: - root: /home/cassandra - paths: - - cassandra - - .m2 + command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_FQLTOOL_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_FQLTOOL_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS_FQLTOOL} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=fqltool-test\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant fqltool-test $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" + - 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: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -9021,7 +7956,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -9033,25 +7968,21 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j8_cqlsh_dtests_py38_vnode: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_dtests_large: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11:latest + resource_class: xlarge working_directory: ~/ shell: /bin/bash -eo pipefail -l parallelism: 4 @@ -9069,51 +8000,27 @@ jobs: # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.8/bin/activate + source ~/env3.6/bin/activate export PATH=$JAVA_HOME/bin:$PATH pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt pip3 uninstall -y cqlsh pip3 freeze - run: - name: Determine Tests to Run (j8_with_vnodes) + name: Determine Tests to Run (j17_large_without_vnodes) no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.8/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j8_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --skip-resource-intensive-tests --pytest-options '-k cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j8_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j8_with_vnodes_raw /tmp/all_dtest_tests_j8_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j8_with_vnodes_raw > /tmp/all_dtest_tests_j8_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j8_with_vnodes > /tmp/split_dtest_tests_j8_with_vnodes.txt\ncat /tmp/split_dtest_tests_j8_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j8_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j8_with_vnodes_final.txt\n" + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j17_large_without_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --only-resource-intensive-tests --force-resource-intensive-tests --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j17_large_without_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j17_large_without_vnodes_raw /tmp/all_dtest_tests_j17_large_without_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j17_large_without_vnodes_raw > /tmp/all_dtest_tests_j17_large_without_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j17_large_without_vnodes > /tmp/split_dtest_tests_j17_large_without_vnodes.txt\ncat /tmp/split_dtest_tests_j17_large_without_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j17_large_without_vnodes_final.txt\ncat /tmp/split_dtest_tests_j17_large_without_vnodes_final.txt\n" - run: - name: Run dtests (j8_with_vnodes) + name: Run dtests (j17_large_without_vnodes) no_output_timeout: 15m - command: | - echo "cat /tmp/split_dtest_tests_j8_with_vnodes_final.txt" - cat /tmp/split_dtest_tests_j8_with_vnodes_final.txt - - source ~/env3.8/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - if [ -n 'CQLSH_PYTHON=/usr/bin/python3.8' ]; then - export CQLSH_PYTHON=/usr/bin/python3.8 - fi - - java -version - cd ~/cassandra-dtest - mkdir -p /tmp/dtest - - echo "env: $(env)" - echo "** done env" - mkdir -p /tmp/results/dtests - # we need the "set -o pipefail" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee - export SPLIT_TESTS=`cat /tmp/split_dtest_tests_j8_with_vnodes_final.txt` - if [ ! -z "$SPLIT_TESTS" ]; then - set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --skip-resource-intensive-tests --log-level="DEBUG" --junit-xml=/tmp/results/dtests/pytest_result_j8_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt - else - echo "Tune your parallelism, there are more containers than test classes. Nothing to do in this container" - (exit 1) - fi + command: "echo \"cat /tmp/split_dtest_tests_j17_large_without_vnodes_final.txt\"\ncat /tmp/split_dtest_tests_j17_large_without_vnodes_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j17_large_without_vnodes_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --only-resource-intensive-tests --force-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j17_large_without_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" - store_test_results: path: /tmp/results - store_artifacts: path: /tmp/dtest - destination: dtest_j8_with_vnodes + destination: dtest_j17_large_without_vnodes - store_artifacts: path: ~/cassandra-dtest/logs - destination: dtest_j8_with_vnodes_logs + destination: dtest_j17_large_without_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -9129,7 +8036,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -9141,28 +8048,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 j11_unit_tests_repeat: docker: - - image: apache/cassandra-testing-ubuntu2004-java11:latest + - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -9218,7 +8121,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -9230,14 +8133,10 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - REPEATED_UPGRADE_DTESTS: null - - REPEATED_UPGRADE_DTESTS_COUNT: 25 - REPEATED_ANT_TEST_TARGET: testsome - REPEATED_ANT_TEST_CLASS: null - REPEATED_ANT_TEST_METHODS: null @@ -9245,10 +8144,9 @@ jobs: - REPEATED_ANT_TEST_COUNT: 500 - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_utests_fqltool: + j17_utests_long: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest + - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l @@ -9257,7 +8155,7 @@ jobs: - attach_workspace: at: /home/cassandra - run: - name: Run Unit Tests (fqltool-test) + name: Run Unit Tests (long-test) command: | export PATH=$JAVA_HOME/bin:$PATH time mv ~/cassandra /tmp @@ -9265,7 +8163,7 @@ jobs: if [ -d ~/dtest_jars ]; then cp ~/dtest_jars/dtest* /tmp/cassandra/build/ fi - ant fqltool-test -Dno-build-test=true + ant long-test -Dno-build-test=true no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -9290,7 +8188,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -9302,41 +8200,59 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j8_cqlshlib_tests: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_dtests_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra - run: - name: Run cqlshlib Unit Tests + name: Clone Cassandra dtest Repository (via git) + command: | + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest + - run: + name: Configure virtualenv and python Dependencies command: | + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.6/bin/activate export PATH=$JAVA_HOME/bin:$PATH - time mv ~/cassandra /tmp - cd /tmp/cassandra/ - ./pylib/cassandra-cqlsh-tests.sh $(pwd) + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze + - run: + name: Determine Tests to Run (j11_with_vnodes) + no_output_timeout: 5m + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --skip-resource-intensive-tests --pytest-options '-k not cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_with_vnodes_raw /tmp/all_dtest_tests_j11_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_with_vnodes_raw > /tmp/all_dtest_tests_j11_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_with_vnodes > /tmp/split_dtest_tests_j11_with_vnodes.txt\ncat /tmp/split_dtest_tests_j11_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\n" + - run: + name: Run dtests (j11_with_vnodes) no_output_timeout: 15m + command: "echo \"cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\"\ncat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --skip-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j11_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" - store_test_results: - path: /tmp/cassandra/pylib + path: /tmp/results + - store_artifacts: + path: /tmp/dtest + destination: dtest_j11_with_vnodes + - store_artifacts: + path: ~/cassandra-dtest/logs + destination: dtest_j11_with_vnodes_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -9352,7 +8268,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -9364,28 +8280,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_dtests_vnode: + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + j17_jvm_dtests_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -9412,37 +8324,20 @@ jobs: which java java -version - run: - name: Clone Cassandra dtest Repository (via git) - command: | - git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest - - run: - name: Configure virtualenv and python Dependencies - command: | - # note, this should be super quick as all dependencies should be pre-installed in the docker image - # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated - # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and - # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) - source ~/env3.6/bin/activate - export PATH=$JAVA_HOME/bin:$PATH - pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt - pip3 uninstall -y cqlsh - pip3 freeze - - run: - name: Determine Tests to Run (j11_with_vnodes) - no_output_timeout: 5m - command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j11_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --skip-resource-intensive-tests --pytest-options '-k not cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j11_with_vnodes_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j11_with_vnodes_raw /tmp/all_dtest_tests_j11_with_vnodes\nelse\n grep -e '' /tmp/all_dtest_tests_j11_with_vnodes_raw > /tmp/all_dtest_tests_j11_with_vnodes || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j11_with_vnodes > /tmp/split_dtest_tests_j11_with_vnodes.txt\ncat /tmp/split_dtest_tests_j11_with_vnodes.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j11_with_vnodes_final.txt\ncat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\n" - - run: - name: Run dtests (j11_with_vnodes) + name: Repeatedly run new or modifed JUnit tests no_output_timeout: 15m - command: "echo \"cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\"\ncat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --skip-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j11_with_vnodes.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" + command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_JVM_DTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_JVM_DTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_JVM_DTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-jvm-dtest-some\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-jvm-dtest-some $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" - store_test_results: - path: /tmp/results + path: /tmp/results/repeated_utests/output - store_artifacts: - path: /tmp/dtest - destination: dtest_j11_with_vnodes + path: /tmp/results/repeated_utests/stdout + destination: stdout - store_artifacts: - path: ~/cassandra-dtest/logs - destination: dtest_j11_with_vnodes_logs + path: /tmp/results/repeated_utests/output + destination: junitxml + - store_artifacts: + path: /tmp/results/repeated_utests/logs + destination: logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -9458,7 +8353,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -9470,29 +8365,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_utests_cdc_repeat: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_dtests_offheap: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -9519,20 +8409,37 @@ jobs: which java java -version - run: - name: Repeatedly run new or modifed JUnit tests + name: Clone Cassandra dtest Repository (via git) + command: | + git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest + - run: + name: Configure virtualenv and python Dependencies + command: | + # note, this should be super quick as all dependencies should be pre-installed in the docker image + # if additional dependencies were added to requirmeents.txt and the docker image hasn't been updated + # we'd have to install it here at runtime -- which will make things slow, so do yourself a favor and + # rebuild the docker image! (it automatically pulls the latest requirements.txt on build) + source ~/env3.6/bin/activate + export PATH=$JAVA_HOME/bin:$PATH + pip3 install --exists-action w --upgrade -r ~/cassandra-dtest/requirements.txt + pip3 uninstall -y cqlsh + pip3 freeze + - run: + name: Determine Tests to Run (j17_dtests_offheap) + no_output_timeout: 5m + command: "# reminder: this code (along with all the steps) is independently executed on every circle container\n# so the goal here is to get the circleci script to return the tests *this* container will run\n# which we do via the `circleci` cli tool.\n\ncd cassandra-dtest\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\necho \"***Collected DTests (j17_dtests_offheap)***\"\nset -eo pipefail && ./run_dtests.py --use-vnodes --use-off-heap-memtables --skip-resource-intensive-tests --pytest-options '-k not cql' --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_j17_dtests_offheap_raw --cassandra-dir=../cassandra\nif [ -z '' ]; then\n mv /tmp/all_dtest_tests_j17_dtests_offheap_raw /tmp/all_dtest_tests_j17_dtests_offheap\nelse\n grep -e '' /tmp/all_dtest_tests_j17_dtests_offheap_raw > /tmp/all_dtest_tests_j17_dtests_offheap || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; }\nfi\nset -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_j17_dtests_offheap > /tmp/split_dtest_tests_j17_dtests_offheap.txt\ncat /tmp/split_dtest_tests_j17_dtests_offheap.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_j17_dtests_offheap_final.txt\ncat /tmp/split_dtest_tests_j17_dtests_offheap_final.txt\n" + - run: + name: Run dtests (j17_dtests_offheap) no_output_timeout: 15m - command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=test-cdc\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant test-cdc $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" + command: "echo \"cat /tmp/split_dtest_tests_j17_dtests_offheap_final.txt\"\ncat /tmp/split_dtest_tests_j17_dtests_offheap_final.txt\n\nsource ~/env3.6/bin/activate\nexport PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\njava -version\ncd ~/cassandra-dtest\nmkdir -p /tmp/dtest\n\necho \"env: $(env)\"\necho \"** done env\"\nmkdir -p /tmp/results/dtests\n# we need the \"set -o pipefail\" here so that the exit code that circleci will actually use is from pytest and not the exit code from tee\nexport SPLIT_TESTS=`cat /tmp/split_dtest_tests_j17_dtests_offheap_final.txt`\nif [ ! -z \"$SPLIT_TESTS\" ]; then\n set -o pipefail && cd ~/cassandra-dtest && pytest --use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests --log-level=\"DEBUG\" --junit-xml=/tmp/results/dtests/pytest_result_j17_dtests_offheap.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt\nelse\n echo \"Tune your parallelism, there are more containers than test classes. Nothing to do in this container\"\n (exit 1)\nfi\n" - store_test_results: - path: /tmp/results/repeated_utests/output - - store_artifacts: - path: /tmp/results/repeated_utests/stdout - destination: stdout + path: /tmp/results - store_artifacts: - path: /tmp/results/repeated_utests/output - destination: junitxml + path: /tmp/dtest + destination: dtest_j17_dtests_offheap - store_artifacts: - path: /tmp/results/repeated_utests/logs - destination: logs + path: ~/cassandra-dtest/logs + destination: dtest_j17_dtests_offheap_logs environment: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -9548,7 +8455,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -9560,28 +8467,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - 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_large_vnode_repeat: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_dtests_large_repeat: docker: - - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + - image: apache/cassandra-testing-ubuntu2004-java11:latest + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -9644,7 +8547,7 @@ jobs: fi vnodes_args="" - if true; then + if false; then vnodes_args="--use-vnodes --num-tokens=16" fi @@ -9680,7 +8583,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -9692,28 +8595,24 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - j11_utests_long_repeat: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j17_utests_long_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -9769,7 +8668,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -9781,83 +8680,64 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - CASSANDRA_USE_JDK11: true - j8_dtest_jars_build: + - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-17-openjdk-amd64 + j11_utests_long_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: Build Cassandra DTest jars + name: Log Environment Information command: | - export PATH=$JAVA_HOME/bin:$PATH - cd ~/cassandra - mkdir ~/dtest_jars - git remote add apache https://github.com/apache/cassandra.git - for branch in cassandra-2.2 cassandra-3.0 cassandra-3.11 cassandra-4.0 cassandra-4.1 trunk; do - # check out the correct cassandra version: - git remote set-branches --add apache '$branch' - git fetch --depth 1 apache $branch - git checkout $branch - git clean -fd - # Loop to prevent failure due to maven-ant-tasks not downloading a jar.. - for x in $(seq 1 3); do - ${ANT_HOME}/bin/ant realclean; ${ANT_HOME}/bin/ant jar dtest-jar - RETURN="$?" - if [ "${RETURN}" -eq "0" ]; then - cp build/dtest*.jar ~/dtest_jars - break - fi - done - # Exit, if we didn't build successfully - if [ "${RETURN}" -ne "0" ]; then - echo "Build failed with exit code: ${RETURN}" - exit ${RETURN} - fi - done - # and build the dtest-jar for the branch under test - ${ANT_HOME}/bin/ant realclean - git checkout origin/$CIRCLE_BRANCH - git clean -fd - for x in $(seq 1 3); do - ${ANT_HOME}/bin/ant realclean; ${ANT_HOME}/bin/ant jar dtest-jar - RETURN="$?" - if [ "${RETURN}" -eq "0" ]; then - cp build/dtest*.jar ~/dtest_jars - break - fi - done - # Exit, if we didn't build successfully - if [ "${RETURN}" -ne "0" ]; then - echo "Build failed with exit code: ${RETURN}" - exit ${RETURN} - fi - ls -l ~/dtest_jars + 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 - - persist_to_workspace: - root: /home/cassandra - paths: - - dtest_jars + command: "set -x\nexport PATH=$JAVA_HOME/bin:$PATH\ntime mv ~/cassandra /tmp\ncd /tmp/cassandra\nif [ -d ~/dtest_jars ]; then\n cp ~/dtest_jars/dtest* /tmp/cassandra/build/\nfi\n\n# Calculate the number of test iterations to be run by the current parallel runner.\ncount=$((${REPEATED_UTESTS_LONG_COUNT} / CIRCLE_NODE_TOTAL))\nif (($CIRCLE_NODE_INDEX < (${REPEATED_UTESTS_LONG_COUNT} % CIRCLE_NODE_TOTAL))); then\n count=$((count+1))\nfi\n\n# Put manually specified tests and automatically detected tests together, removing duplicates\ntests=$(echo ${REPEATED_UTESTS_LONG} | sed -e \"s///\" | sed -e \"s/ //\" | tr \",\" \"\\n\" | tr \" \" \"\\n\" | sort -n | uniq -u)\necho \"Tests to be repeated: ${tests}\"\n\n# Prepare the JVM dtests vnodes argument, which is optional.\nvnodes=false\nvnodes_args=\"\"\nif [ \"$vnodes\" = true ] ; then\n vnodes_args=\"-Dtest.jvm.args='-Dcassandra.dtest.num_tokens=16'\"\nfi\n\n# Prepare the testtag for the target, used by the test macro in build.xml to group the output files\ntarget=long-testsome\ntesttag=\"\"\nif [[ $target == \"test-cdc\" ]]; then\n testtag=\"cdc\"\nelif [[ $target == \"test-compression\" ]]; then\n testtag=\"compression\"\nelif [[ $target == \"test-system-keyspace-directory\" ]]; then\n testtag=\"system_keyspace_directory\"\nelif [[ $target == \"test-trie\" ]]; then\n testtag=\"trie\"\nfi\n\n# Run each test class as many times as requested.\nexit_code=\"$?\"\nfor test in $tests; do\n\n # Split class and method names from the test name\n if [[ $test =~ \"#\" ]]; then\n class=${test%\"#\"*}\n method=${test#*\"#\"}\n else\n class=$test\n method=\"\"\n fi\n\n # Prepare the -Dtest.name argument.\n # It can be the fully qualified class name or the short class name, depending on the target.\n if [[ $target == \"test\" || \\\n $target == \"test-cdc\" || \\\n $target == \"test-compression\" || \\\n $target == \"test-trie\" || \\\n $target == \"test-system-keyspace-directory\" || \\\n $target == \"fqltool-test\" || \\\n $target == \"long-test\" || \\\n $target == \"stress-test\" || \\\n $target == \"test-simulator-dtest\" ]]; then\n name_arg=\"-Dtest.name=${class##*.}\"\n else\n name_arg=\"-Dtest.name=$class\"\n fi\n\n # Prepare the -Dtest.methods argument, which is optional\n if [[ $method == \"\" ]]; then\n methods_arg=\"\"\n else\n methods_arg=\"-Dtest.methods=$method\"\n fi\n\n for i in $(seq -w 1 $count); do\n echo \"Running test $test, iteration $i of $count\"\n\n # run the test\n status=\"passes\"\n if !( set -o pipefail && \\\n ant long-testsome $name_arg $methods_arg $vnodes_args -Dno-build-test=true | \\\n tee stdout.txt \\\n ); then\n status=\"fails\"\n exit_code=1\n fi\n\n # move the stdout output file\n dest=/tmp/results/repeated_utests/stdout/${status}/${i}\n mkdir -p $dest\n mv stdout.txt $dest/${test}.txt\n\n # move the XML output files\n source=build/test/output/${testtag}\n dest=/tmp/results/repeated_utests/output/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n\n # move the log files\n source=build/test/logs/${testtag}\n dest=/tmp/results/repeated_utests/logs/${status}/${i}\n mkdir -p $dest\n if [[ -d $source && -n \"$(ls $source)\" ]]; then\n mv $source/* $dest/\n fi\n \n # maybe stop iterations on test failure\n if [[ ${REPEATED_TESTS_STOP_ON_FAILURE} = true ]] && (( $exit_code > 0 )); then\n break\n fi\n done\ndone\n(exit ${exit_code})\n" + - 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: - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 @@ -9873,7 +8753,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -9885,843 +8765,943 @@ jobs: - REPEATED_SIMULATOR_DTESTS_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_LARGE_DTESTS: null - REPEATED_LARGE_DTESTS_COUNT: 100 - - 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_VNODES: false - REPEATED_ANT_TEST_COUNT: 500 - - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 workflows: version: 2 - java8_separate_tests: + java11_separate_tests: jobs: - - start_j8_build: - type: approval - - j8_build: - requires: - - start_j8_build - - start_j8_unit_tests: + - start_j11_build: type: approval - - j8_unit_tests: + - j11_build: requires: - - start_j8_unit_tests - - j8_build - - start_j8_jvm_dtests: + - start_j11_build + - start_j11_unit_tests: type: approval - - j8_jvm_dtests: + - j11_unit_tests: requires: - - start_j8_jvm_dtests - - j8_build - - start_j8_jvm_dtests_vnode: + - start_j11_unit_tests + - j11_build + - start_j11_unit_tests_repeat: type: approval - - j8_jvm_dtests_vnode: + - j11_unit_tests_repeat: requires: - - start_j8_jvm_dtests_vnode - - j8_build + - start_j11_unit_tests_repeat + - j11_build - start_j11_jvm_dtests: type: approval - j11_jvm_dtests: requires: - start_j11_jvm_dtests - - j8_build + - j11_build - start_j11_jvm_dtests_vnode: type: approval - j11_jvm_dtests_vnode: requires: - start_j11_jvm_dtests_vnode - - j8_build - - start_j8_simulator_dtests: + - j11_build + - start_j17_jvm_dtests: type: approval - - j8_simulator_dtests: + - j17_jvm_dtests: requires: - - start_j8_simulator_dtests - - j8_build - - start_j8_cqlshlib_tests: + - start_j17_jvm_dtests + - j11_build + - start_j17_jvm_dtests_vnode: type: approval - - j8_cqlshlib_tests: + - j17_jvm_dtests_vnode: requires: - - start_j8_cqlshlib_tests - - j8_build - - start_j8_cqlshlib_cython_tests: + - start_j17_jvm_dtests_vnode + - j11_build + - start_j11_simulator_dtests: type: approval - - j8_cqlshlib_cython_tests: + - j11_simulator_dtests: requires: - - start_j8_cqlshlib_cython_tests - - j8_build + - start_j11_simulator_dtests + - j11_build - start_j11_cqlshlib_tests: type: approval - j11_cqlshlib_tests: requires: - start_j11_cqlshlib_tests - - j8_build + - j11_build - start_j11_cqlshlib_cython_tests: type: approval - j11_cqlshlib_cython_tests: requires: - start_j11_cqlshlib_cython_tests - - j8_build - - start_j11_unit_tests: + - j11_build + - start_j17_cqlshlib_tests: type: approval - - j11_unit_tests: + - j17_cqlshlib_tests: requires: - - start_j11_unit_tests - - j8_build - - start_j8_utests_long: + - start_j17_cqlshlib_tests + - j11_build + - start_j17_cqlshlib_cython_tests: + type: approval + - j17_cqlshlib_cython_tests: + requires: + - start_j17_cqlshlib_cython_tests + - j11_build + - start_j17_unit_tests: + type: approval + - j17_unit_tests: + requires: + - start_j17_unit_tests + - j11_build + - start_j17_unit_tests_repeat: type: approval - - j8_utests_long: + - j17_unit_tests_repeat: requires: - - start_j8_utests_long - - j8_build + - start_j17_unit_tests_repeat + - j11_build - start_j11_utests_long: type: approval - j11_utests_long: requires: - start_j11_utests_long - - j8_build - - start_j8_utests_cdc: + - j11_build + - start_j17_utests_long: type: approval - - j8_utests_cdc: + - j17_utests_long: requires: - - start_j8_utests_cdc - - j8_build + - start_j17_utests_long + - j11_build - start_j11_utests_cdc: type: approval - j11_utests_cdc: requires: - start_j11_utests_cdc - - j8_build - - start_j8_utests_compression: + - j11_build + - start_j17_utests_cdc: + type: approval + - j17_utests_cdc: + requires: + - start_j17_utests_cdc + - j11_build + - start_j11_utests_cdc_repeat: type: approval - - j8_utests_compression: + - j11_utests_cdc_repeat: requires: - - start_j8_utests_compression - - j8_build + - start_j11_utests_cdc_repeat + - j11_build + - start_j17_utests_cdc_repeat: + type: approval + - j17_utests_cdc_repeat: + requires: + - start_j17_utests_cdc_repeat + - j11_build - start_j11_utests_compression: type: approval - j11_utests_compression: requires: - start_j11_utests_compression - - j8_build - - start_j8_utests_trie: + - j11_build + - start_j17_utests_compression: + type: approval + - j17_utests_compression: + requires: + - start_j17_utests_compression + - j11_build + - start_j11_utests_compression_repeat: type: approval - - j8_utests_trie: + - j11_utests_compression_repeat: requires: - - start_j8_utests_trie - - j8_build + - start_j11_utests_compression_repeat + - j11_build + - start_j17_utests_compression_repeat: + type: approval + - j17_utests_compression_repeat: + requires: + - start_j17_utests_compression_repeat + - j11_build - start_j11_utests_trie: type: approval - j11_utests_trie: requires: - start_j11_utests_trie - - j8_build - - start_j8_utests_stress: + - j11_build + - start_j17_utests_trie: + type: approval + - j17_utests_trie: + requires: + - start_j17_utests_trie + - j11_build + - start_j11_utests_trie_repeat: type: approval - - j8_utests_stress: + - j11_utests_trie_repeat: requires: - - start_j8_utests_stress - - j8_build + - start_j11_utests_trie_repeat + - j11_build + - start_j17_utests_trie_repeat: + type: approval + - j17_utests_trie_repeat: + requires: + - start_j17_utests_trie_repeat + - j11_build - start_j11_utests_stress: type: approval - j11_utests_stress: requires: - start_j11_utests_stress - - j8_build - - start_j8_utests_fqltool: + - j11_build + - start_j17_utests_stress: type: approval - - j8_utests_fqltool: + - j17_utests_stress: requires: - - start_j8_utests_fqltool - - j8_build + - start_j17_utests_stress + - j11_build - start_j11_utests_fqltool: type: approval - j11_utests_fqltool: requires: - start_j11_utests_fqltool - - j8_build - - start_j8_utests_system_keyspace_directory: + - j11_build + - start_j17_utests_fqltool: type: approval - - j8_utests_system_keyspace_directory: + - j17_utests_fqltool: requires: - - start_j8_utests_system_keyspace_directory - - j8_build + - start_j17_utests_fqltool + - j11_build - start_j11_utests_system_keyspace_directory: type: approval - j11_utests_system_keyspace_directory: requires: - start_j11_utests_system_keyspace_directory - - j8_build - - start_j8_dtest_jars_build: - type: approval - - j8_dtest_jars_build: - requires: - - j8_build - - start_j8_dtest_jars_build - - start_jvm_upgrade_dtests: - type: approval - - j8_jvm_upgrade_dtests: - requires: - - start_jvm_upgrade_dtests - - j8_dtest_jars_build - - start_j8_dtests: + - j11_build + - start_j17_utests_system_keyspace_directory: type: approval - - j8_dtests: + - j17_utests_system_keyspace_directory: requires: - - start_j8_dtests - - j8_build - - start_j8_dtests_vnode: + - start_j17_utests_system_keyspace_directory + - j11_build + - start_j11_utests_system_keyspace_directory_repeat: type: approval - - j8_dtests_vnode: + - j11_utests_system_keyspace_directory_repeat: requires: - - start_j8_dtests_vnode - - j8_build - - start_j8_dtests_offheap: + - start_j11_utests_system_keyspace_directory_repeat + - j11_build + - start_j17_utests_system_keyspace_directory_repeat: type: approval - - j8_dtests_offheap: + - j17_utests_system_keyspace_directory_repeat: requires: - - start_j8_dtests_offheap - - j8_build + - start_j17_utests_system_keyspace_directory_repeat + - j11_build - start_j11_dtests: type: approval - j11_dtests: requires: - start_j11_dtests - - j8_build + - j11_build - start_j11_dtests_vnode: type: approval - j11_dtests_vnode: requires: - start_j11_dtests_vnode - - j8_build + - j11_build - start_j11_dtests_offheap: type: approval - j11_dtests_offheap: requires: - start_j11_dtests_offheap - - j8_build - - start_j8_dtests_large: + - j11_build + - start_j17_dtests: + type: approval + - j17_dtests: + requires: + - start_j17_dtests + - j11_build + - start_j17_dtests_vnode: type: approval - - j8_dtests_large: + - j17_dtests_vnode: requires: - - start_j8_dtests_large - - j8_build - - start_j8_dtests_large_vnode: + - start_j17_dtests_vnode + - j11_build + - start_j17_dtests_offheap: type: approval - - j8_dtests_large_vnode: + - j17_dtests_offheap: requires: - - start_j8_dtests_large_vnode - - j8_build + - start_j17_dtests_offheap + - j11_build - start_j11_dtests_large: type: approval - j11_dtests_large: requires: - start_j11_dtests_large - - j8_build + - j11_build - start_j11_dtests_large_vnode: type: approval - j11_dtests_large_vnode: requires: - start_j11_dtests_large_vnode - - j8_build - - start_upgrade_dtests: - type: approval - - j8_upgrade_dtests: - requires: - - start_upgrade_dtests - - j8_build - - start_j8_cqlsh_tests: + - j11_build + - start_j17_dtests_large: type: approval - - j8_cqlsh_dtests_py3: - requires: - - start_j8_cqlsh_tests - - j8_build - - j8_cqlsh_dtests_py3_vnode: - requires: - - start_j8_cqlsh_tests - - j8_build - - j8_cqlsh_dtests_py38: - requires: - - start_j8_cqlsh_tests - - j8_build - - j8_cqlsh_dtests_py311: - requires: - - start_j8_cqlsh_tests - - j8_build - - j8_cqlsh_dtests_py38_vnode: + - j17_dtests_large: requires: - - start_j8_cqlsh_tests - - j8_build - - j8_cqlsh_dtests_py311_vnode: - requires: - - start_j8_cqlsh_tests - - j8_build - - start_j8_cqlsh_tests_offheap: + - start_j17_dtests_large + - j11_build + - start_j17_dtests_large_vnode: type: approval - - j8_cqlsh_dtests_py3_offheap: - requires: - - start_j8_cqlsh_tests_offheap - - j8_build - - j8_cqlsh_dtests_py38_offheap: - requires: - - start_j8_cqlsh_tests_offheap - - j8_build - - j8_cqlsh_dtests_py311_offheap: + - j17_dtests_large_vnode: requires: - - start_j8_cqlsh_tests_offheap - - j8_build + - start_j17_dtests_large_vnode + - j11_build - start_j11_cqlsh_tests: type: approval - j11_cqlsh_dtests_py3: requires: - start_j11_cqlsh_tests - - j8_build + - j11_build - j11_cqlsh_dtests_py3_vnode: requires: - start_j11_cqlsh_tests - - j8_build + - j11_build - j11_cqlsh_dtests_py38: requires: - start_j11_cqlsh_tests - - j8_build + - j11_build - j11_cqlsh_dtests_py311: requires: - start_j11_cqlsh_tests - - j8_build + - j11_build - j11_cqlsh_dtests_py38_vnode: requires: - start_j11_cqlsh_tests - - j8_build + - j11_build - j11_cqlsh_dtests_py311_vnode: requires: - start_j11_cqlsh_tests - - j8_build + - j11_build - start_j11_cqlsh_tests_offheap: type: approval - j11_cqlsh_dtests_py3_offheap: requires: - start_j11_cqlsh_tests_offheap - - j8_build + - j11_build - j11_cqlsh_dtests_py38_offheap: requires: - start_j11_cqlsh_tests_offheap - - j8_build + - j11_build - j11_cqlsh_dtests_py311_offheap: requires: - start_j11_cqlsh_tests_offheap - - j8_build - java8_pre-commit_tests: + - j11_build + - start_j17_cqlsh_tests: + type: approval + - j17_cqlsh_dtests_py3: + requires: + - start_j17_cqlsh_tests + - j11_build + - j17_cqlsh_dtests_py3_vnode: + requires: + - start_j17_cqlsh_tests + - j11_build + - j17_cqlsh_dtests_py38: + requires: + - start_j17_cqlsh_tests + - j11_build + - j17_cqlsh_dtests_py311: + requires: + - start_j17_cqlsh_tests + - j11_build + - j17_cqlsh_dtests_py38_vnode: + requires: + - start_j17_cqlsh_tests + - j11_build + - j17_cqlsh_dtests_py311_vnode: + requires: + - start_j17_cqlsh_tests + - j11_build + - start_j17_cqlsh_tests_offheap: + type: approval + - j17_cqlsh_dtests_py3_offheap: + requires: + - start_j17_cqlsh_tests_offheap + - j11_build + - j17_cqlsh_dtests_py38_offheap: + requires: + - start_j17_cqlsh_tests_offheap + - j11_build + - j17_cqlsh_dtests_py311_offheap: + requires: + - start_j17_cqlsh_tests_offheap + - j11_build + java11_pre-commit_tests: jobs: - start_pre-commit_tests: type: approval - - j8_build: + - j11_build: requires: - start_pre-commit_tests - - j8_unit_tests: - requires: - - j8_build - - j8_simulator_dtests: + - j11_unit_tests: requires: - - j8_build - - j8_jvm_dtests: + - j11_build + - j11_unit_tests_repeat: requires: - - j8_build - - j8_jvm_dtests_vnode: + - j11_build + - j11_simulator_dtests: requires: - - j8_build + - j11_build - j11_jvm_dtests: requires: - - j8_build + - j11_build - j11_jvm_dtests_vnode: requires: - - j8_build - - j8_cqlshlib_tests: + - j11_build + - j17_jvm_dtests: requires: - - j8_build - - j8_cqlshlib_cython_tests: + - j11_build + - j17_jvm_dtests_vnode: requires: - - j8_build + - j11_build - j11_cqlshlib_tests: requires: - - j8_build + - j11_build - j11_cqlshlib_cython_tests: requires: - - j8_build - - j11_unit_tests: + - j11_build + - j17_cqlshlib_tests: + requires: + - j11_build + - j17_cqlshlib_cython_tests: + requires: + - j11_build + - j17_unit_tests: + requires: + - j11_build + - j17_unit_tests_repeat: requires: - - j8_build + - j11_build - start_utests_long: type: approval - - j8_utests_long: + - j11_utests_long: requires: - start_utests_long - - j8_build - - j11_utests_long: + - j11_build + - j17_utests_long: requires: - start_utests_long - - j8_build + - j11_build - start_utests_cdc: type: approval - - j8_utests_cdc: + - j11_utests_cdc: requires: - start_utests_cdc - - j8_build - - j11_utests_cdc: + - j11_build + - j17_utests_cdc: + requires: + - start_utests_cdc + - j11_build + - j11_utests_cdc_repeat: + requires: + - start_utests_cdc + - j11_build + - j17_utests_cdc_repeat: requires: - start_utests_cdc - - j8_build + - j11_build - start_utests_compression: type: approval - - j8_utests_compression: + - j11_utests_compression: requires: - start_utests_compression - - j8_build - - j11_utests_compression: + - j11_build + - j17_utests_compression: + requires: + - start_utests_compression + - j11_build + - j11_utests_compression_repeat: + requires: + - start_utests_compression + - j11_build + - j17_utests_compression_repeat: + requires: + - start_utests_compression + - j11_build + - start_utests_trie: + type: approval + - j11_utests_trie: + requires: + - start_utests_trie + - j11_build + - j17_utests_trie: requires: - - start_utests_compression - - j8_build - - start_utests_trie: - type: approval - - j8_utests_trie: + - start_utests_trie + - j11_build + - j11_utests_trie_repeat: requires: - start_utests_trie - - j8_build - - j11_utests_trie: + - j11_build + - j17_utests_trie_repeat: requires: - start_utests_trie - - j8_build + - j11_build - start_utests_stress: type: approval - - j8_utests_stress: + - j11_utests_stress: requires: - start_utests_stress - - j8_build - - j11_utests_stress: + - j11_build + - j17_utests_stress: requires: - start_utests_stress - - j8_build + - j11_build - start_utests_fqltool: type: approval - - j8_utests_fqltool: + - j11_utests_fqltool: requires: - start_utests_fqltool - - j8_build - - j11_utests_fqltool: + - j11_build + - j17_utests_fqltool: requires: - start_utests_fqltool - - j8_build + - j11_build - start_utests_system_keyspace_directory: type: approval - - j8_utests_system_keyspace_directory: - requires: - - j8_build - j11_utests_system_keyspace_directory: requires: - - start_utests_system_keyspace_directory - - j8_build - - start_jvm_upgrade_dtests: - type: approval - - j8_dtest_jars_build: - requires: - - j8_build - - start_jvm_upgrade_dtests - - j8_jvm_upgrade_dtests: - requires: - - j8_dtest_jars_build - - j8_dtests: + - j11_build + - j17_utests_system_keyspace_directory: requires: - - j8_build - - j8_dtests_vnode: + - start_utests_system_keyspace_directory + - j11_build + - j11_utests_system_keyspace_directory_repeat: requires: - - j8_build - - start_j8_dtests_offheap: - type: approval - - j8_dtests_offheap: + - j11_build + - j17_utests_system_keyspace_directory_repeat: requires: - - start_j8_dtests_offheap - - j8_build + - start_utests_system_keyspace_directory + - j11_build - j11_dtests: requires: - - j8_build + - j11_build - j11_dtests_vnode: requires: - - j8_build + - j11_build - start_j11_dtests_offheap: type: approval - j11_dtests_offheap: requires: - start_j11_dtests_offheap - - j8_build - - start_j8_dtests_large: - type: approval - - j8_dtests_large: + - j11_build + - j17_dtests: requires: - - start_j8_dtests_large - - j8_build - - j8_dtests_large_vnode: + - j11_build + - j17_dtests_vnode: + requires: + - j11_build + - start_j17_dtests_offheap: + type: approval + - j17_dtests_offheap: requires: - - start_j8_dtests_large - - j8_build + - start_j17_dtests_offheap + - j11_build - start_j11_dtests_large: type: approval - j11_dtests_large: requires: - start_j11_dtests_large - - j8_build + - j11_build - j11_dtests_large_vnode: requires: - start_j11_dtests_large - - j8_build - - start_upgrade_dtests: - type: approval - - j8_upgrade_dtests: - requires: - - j8_build - - start_upgrade_dtests - - j8_cqlsh_dtests_py3: - requires: - - j8_build - - j8_cqlsh_dtests_py3_vnode: - requires: - - j8_build - - j8_cqlsh_dtests_py38: - requires: - - j8_build - - j8_cqlsh_dtests_py311: - requires: - - j8_build - - j8_cqlsh_dtests_py38_vnode: - requires: - - j8_build - - j8_cqlsh_dtests_py311_vnode: - requires: - - j8_build - - start_j8_cqlsh_dtests_offheap: + - j11_build + - start_j17_dtests_large: type: approval - - j8_cqlsh_dtests_py3_offheap: - requires: - - start_j8_cqlsh_dtests_offheap - - j8_build - - j8_cqlsh_dtests_py38_offheap: + - j17_dtests_large: requires: - - start_j8_cqlsh_dtests_offheap - - j8_build - - j8_cqlsh_dtests_py311_offheap: + - start_j17_dtests_large + - j11_build + - j17_dtests_large_vnode: requires: - - start_j8_cqlsh_dtests_offheap - - j8_build + - start_j17_dtests_large + - j11_build - j11_cqlsh_dtests_py3: requires: - - j8_build + - j11_build - j11_cqlsh_dtests_py3_vnode: requires: - - j8_build + - j11_build - j11_cqlsh_dtests_py38: requires: - - j8_build + - j11_build - j11_cqlsh_dtests_py311: requires: - - j8_build + - j11_build - j11_cqlsh_dtests_py38_vnode: requires: - - j8_build + - j11_build - j11_cqlsh_dtests_py311_vnode: requires: - - j8_build - - start_j11_cqlsh-dtests-offheap: + - j11_build + - start_j11_cqlsh_dtests_offheap: type: approval - j11_cqlsh_dtests_py3_offheap: requires: - - start_j11_cqlsh-dtests-offheap - - j8_build + - start_j11_cqlsh_dtests_offheap + - j11_build - j11_cqlsh_dtests_py38_offheap: requires: - - start_j11_cqlsh-dtests-offheap - - j8_build + - start_j11_cqlsh_dtests_offheap + - j11_build - j11_cqlsh_dtests_py311_offheap: requires: - - start_j11_cqlsh-dtests-offheap - - j8_build - java11_separate_tests: + - start_j11_cqlsh_dtests_offheap + - j11_build + - j17_cqlsh_dtests_py3: + requires: + - j11_build + - j17_cqlsh_dtests_py3_vnode: + requires: + - j11_build + - j17_cqlsh_dtests_py38: + requires: + - j11_build + - j17_cqlsh_dtests_py311: + requires: + - j11_build + - j17_cqlsh_dtests_py38_vnode: + requires: + - j11_build + - j17_cqlsh_dtests_py311_vnode: + requires: + - j11_build + - start_j17_cqlsh-dtests-offheap: + type: approval + - j17_cqlsh_dtests_py3_offheap: + requires: + - start_j17_cqlsh-dtests-offheap + - j11_build + - j17_cqlsh_dtests_py38_offheap: + requires: + - start_j17_cqlsh-dtests-offheap + - j11_build + - j17_cqlsh_dtests_py311_offheap: + requires: + - start_j17_cqlsh-dtests-offheap + - j11_build + java17_separate_tests: jobs: - - start_j11_build: + - start_j17_build: type: approval - - j11_build: + - j17_build: requires: - - start_j11_build - - start_j11_unit_tests: + - start_j17_build + - start_j17_unit_tests: type: approval - - j11_unit_tests: + - j17_unit_tests: requires: - - start_j11_unit_tests - - j11_build - - start_j11_jvm_dtests: + - start_j17_unit_tests + - j17_build + - start_j17_unit_tests_repeat: type: approval - - j11_jvm_dtests: + - j17_unit_tests_repeat: requires: - - start_j11_jvm_dtests - - j11_build - - start_j11_jvm_dtests_vnode: + - start_j17_unit_tests_repeat + - j17_build + - start_j17_jvm_dtests: type: approval - - j11_jvm_dtests_vnode: + - j17_jvm_dtests: requires: - - start_j11_jvm_dtests_vnode - - j11_build - - start_j11_simulator_dtests: + - start_j17_jvm_dtests + - j17_build + - start_j17_jvm_dtests_vnode: type: approval - - j11_simulator_dtests: + - j17_jvm_dtests_vnode: requires: - - start_j11_simulator_dtests - - j11_build - - start_j11_cqlshlib_tests: + - start_j17_jvm_dtests_vnode + - j17_build + - start_j17_cqlshlib_tests: type: approval - - j11_cqlshlib_tests: + - j17_cqlshlib_tests: requires: - - start_j11_cqlshlib_tests - - j11_build - - start_j11_cqlshlib_cython_tests: + - start_j17_cqlshlib_tests + - j17_build + - start_j17_cqlshlib_cython_tests: type: approval - - j11_cqlshlib_cython_tests: + - j17_cqlshlib_cython_tests: requires: - - start_j11_cqlshlib_cython_tests - - j11_build - - start_j11_dtests: + - start_j17_cqlshlib_cython_tests + - j17_build + - start_j17_dtests: type: approval - - j11_dtests: + - j17_dtests: requires: - - start_j11_dtests - - j11_build - - start_j11_dtests_vnode: + - start_j17_dtests + - j17_build + - start_j17_dtests_vnode: type: approval - - j11_dtests_vnode: + - j17_dtests_vnode: requires: - - start_j11_dtests_vnode - - j11_build - - start_j11_dtests_offheap: + - start_j17_dtests_vnode + - j17_build + - start_j17_dtests_offheap: type: approval - - j11_dtests_offheap: + - j17_dtests_offheap: requires: - - start_j11_dtests_offheap - - j11_build - - start_j11_dtests_large: + - start_j17_dtests_offheap + - j17_build + - start_j17_dtests_large: type: approval - - j11_dtests_large: + - j17_dtests_large: requires: - - start_j11_dtests_large - - j11_build - - start_j11_dtests_large_vnode: + - start_j17_dtests_large + - j17_build + - start_j17_dtests_large_vnode: type: approval - - j11_dtests_large_vnode: + - j17_dtests_large_vnode: requires: - - start_j11_dtests_large_vnode - - j11_build - - start_j11_cqlsh_tests: + - start_j17_dtests_large_vnode + - j17_build + - start_j17_cqlsh_tests: type: approval - - j11_cqlsh_dtests_py3: + - j17_cqlsh_dtests_py3: requires: - - start_j11_cqlsh_tests - - j11_build - - j11_cqlsh_dtests_py3_vnode: + - start_j17_cqlsh_tests + - j17_build + - j17_cqlsh_dtests_py3_vnode: requires: - - start_j11_cqlsh_tests - - j11_build - - j11_cqlsh_dtests_py38: + - start_j17_cqlsh_tests + - j17_build + - j17_cqlsh_dtests_py38: requires: - - start_j11_cqlsh_tests - - j11_build - - j11_cqlsh_dtests_py311: + - start_j17_cqlsh_tests + - j17_build + - j17_cqlsh_dtests_py311: requires: - - start_j11_cqlsh_tests - - j11_build - - j11_cqlsh_dtests_py38_vnode: + - start_j17_cqlsh_tests + - j17_build + - j17_cqlsh_dtests_py38_vnode: requires: - - start_j11_cqlsh_tests - - j11_build - - j11_cqlsh_dtests_py311_vnode: + - start_j17_cqlsh_tests + - j17_build + - j17_cqlsh_dtests_py311_vnode: requires: - - start_j11_cqlsh_tests - - j11_build - - start_j11_cqlsh-dtests-offheap: + - start_j17_cqlsh_tests + - j17_build + - start_j17_cqlsh-dtests-offheap: type: approval - - j11_cqlsh_dtests_py3_offheap: + - j17_cqlsh_dtests_py3_offheap: requires: - - start_j11_cqlsh-dtests-offheap - - j11_build - - j11_cqlsh_dtests_py38_offheap: + - start_j17_cqlsh-dtests-offheap + - j17_build + - j17_cqlsh_dtests_py38_offheap: requires: - - start_j11_cqlsh-dtests-offheap - - j11_build - - j11_cqlsh_dtests_py311_offheap: + - start_j17_cqlsh-dtests-offheap + - j17_build + - j17_cqlsh_dtests_py311_offheap: requires: - - start_j11_cqlsh-dtests-offheap - - j11_build - - start_j11_utests_long: + - start_j17_cqlsh-dtests-offheap + - j17_build + - start_j17_utests_long: type: approval - - j11_utests_long: + - j17_utests_long: requires: - - start_j11_utests_long - - j11_build - - start_j11_utests_cdc: + - start_j17_utests_long + - j17_build + - start_j17_utests_cdc: type: approval - - j11_utests_cdc: + - j17_utests_cdc: requires: - - start_j11_utests_cdc - - j11_build - - start_j11_utests_compression: + - start_j17_utests_cdc + - j17_build + - start_j17_utests_cdc_repeat: type: approval - - j11_utests_compression: + - j17_utests_cdc_repeat: requires: - - start_j11_utests_compression - - j11_build - - start_j11_utests_trie: + - start_j17_utests_cdc_repeat + - j17_build + - start_j17_utests_compression: type: approval - - j11_utests_trie: + - j17_utests_compression: requires: - - start_j11_utests_trie - - j11_build - - start_j11_utests_stress: + - start_j17_utests_compression + - j17_build + - start_j17_utests_compression_repeat: type: approval - - j11_utests_stress: + - j17_utests_compression_repeat: requires: - - start_j11_utests_stress - - j11_build - - start_j11_utests_fqltool: + - start_j17_utests_compression_repeat + - j17_build + - start_j17_utests_trie: type: approval - - j11_utests_fqltool: + - j17_utests_trie: requires: - - start_j11_utests_fqltool - - j11_build - - start_j11_utests_system_keyspace_directory: + - start_j17_utests_trie + - j17_build + - start_j17_utests_trie_repeat: type: approval - - j11_utests_system_keyspace_directory: + - j17_utests_trie_repeat: requires: - - start_j11_utests_system_keyspace_directory - - j11_build - java11_pre-commit_tests: + - start_j17_utests_trie_repeat + - j17_build + - start_j17_utests_stress: + type: approval + - j17_utests_stress: + requires: + - start_j17_utests_stress + - j17_build + - start_j17_utests_fqltool: + type: approval + - j17_utests_fqltool: + requires: + - start_j17_utests_fqltool + - j17_build + - start_j17_utests_system_keyspace_directory: + type: approval + - j17_utests_system_keyspace_directory: + requires: + - start_j17_utests_system_keyspace_directory + - j17_build + - start_j17_utests_system_keyspace_directory_repeat: + type: approval + - j17_utests_system_keyspace_directory_repeat: + requires: + - start_j17_utests_system_keyspace_directory_repeat + - j17_build + java17_pre-commit_tests: jobs: - start_pre-commit_tests: type: approval - - j11_build: + - j17_build: requires: - start_pre-commit_tests - - j11_unit_tests: + - j17_unit_tests: requires: - - j11_build - - j11_jvm_dtests: + - j17_build + - j17_unit_tests_repeat: requires: - - j11_build - - j11_jvm_dtests_vnode: + - j17_build + - j17_jvm_dtests: requires: - - j11_build - - j11_simulator_dtests: + - j17_build + - j17_jvm_dtests_vnode: requires: - - j11_build - - j11_cqlshlib_tests: + - j17_build + - j17_cqlshlib_tests: requires: - - j11_build - - j11_cqlshlib_cython_tests: + - j17_build + - j17_cqlshlib_cython_tests: requires: - - j11_build - - j11_dtests: + - j17_build + - j17_dtests: requires: - - j11_build - - j11_dtests_vnode: + - j17_build + - j17_dtests_vnode: requires: - - j11_build - - start_j11_dtests_offheap: + - j17_build + - start_j17_dtests_offheap: type: approval - - j11_dtests_offheap: + - j17_dtests_offheap: requires: - - start_j11_dtests_offheap - - j11_build - - start_j11_dtests_large: + - start_j17_dtests_offheap + - j17_build + - start_j17_dtests_large: type: approval - - j11_dtests_large: + - j17_dtests_large: requires: - - start_j11_dtests_large - - j11_build - - j11_dtests_large_vnode: + - start_j17_dtests_large + - j17_build + - j17_dtests_large_vnode: requires: - - start_j11_dtests_large - - j11_build - - j11_cqlsh_dtests_py3: + - start_j17_dtests_large + - j17_build + - j17_cqlsh_dtests_py3: requires: - - j11_build - - j11_cqlsh_dtests_py3_vnode: + - j17_build + - j17_cqlsh_dtests_py3_vnode: requires: - - j11_build - - j11_cqlsh_dtests_py38: + - j17_build + - j17_cqlsh_dtests_py38: requires: - - j11_build - - j11_cqlsh_dtests_py311: + - j17_build + - j17_cqlsh_dtests_py311: requires: - - j11_build - - j11_cqlsh_dtests_py38_vnode: + - j17_build + - j17_cqlsh_dtests_py38_vnode: requires: - - j11_build - - j11_cqlsh_dtests_py311_vnode: + - j17_build + - j17_cqlsh_dtests_py311_vnode: requires: - - j11_build - - start_j11_cqlsh-dtests-offheap: + - j17_build + - start_j17_cqlsh-dtests-offheap: type: approval - - j11_cqlsh_dtests_py3_offheap: + - j17_cqlsh_dtests_py3_offheap: requires: - - start_j11_cqlsh-dtests-offheap - - j11_build - - j11_cqlsh_dtests_py38_offheap: + - start_j17_cqlsh-dtests-offheap + - j17_build + - j17_cqlsh_dtests_py38_offheap: requires: - - start_j11_cqlsh-dtests-offheap - - j11_build - - j11_cqlsh_dtests_py311_offheap: + - start_j17_cqlsh-dtests-offheap + - j17_build + - j17_cqlsh_dtests_py311_offheap: requires: - - start_j11_cqlsh-dtests-offheap - - j11_build + - start_j17_cqlsh-dtests-offheap + - j17_build - start_utests_long: type: approval - - j11_utests_long: + - j17_utests_long: requires: - start_utests_long - - j11_build + - j17_build - start_utests_cdc: type: approval - - j11_utests_cdc: + - j17_utests_cdc: requires: - start_utests_cdc - - j11_build + - j17_build + - j17_utests_cdc_repeat: + requires: + - start_utests_cdc + - j17_build - start_utests_compression: type: approval - - j11_utests_compression: + - j17_utests_compression: requires: - start_utests_compression - - j11_build + - j17_build + - j17_utests_compression_repeat: + requires: + - start_utests_compression + - j17_build - start_utests_trie: type: approval - - j11_utests_trie: + - j17_utests_trie: requires: - start_utests_trie - - j11_build + - j17_build + - j17_utests_trie_repeat: + requires: + - start_utests_trie + - j17_build - start_utests_stress: type: approval - - j11_utests_stress: + - j17_utests_stress: requires: - start_utests_stress - - j11_build + - j17_build - start_utests_fqltool: type: approval - - j11_utests_fqltool: + - j17_utests_fqltool: requires: - start_utests_fqltool - - j11_build + - j17_build - start_utests_system_keyspace_directory: type: approval - - j11_utests_system_keyspace_directory: + - j17_utests_system_keyspace_directory: requires: - start_utests_system_keyspace_directory - - j11_build + - j17_build + - j17_utests_system_keyspace_directory_repeat: + requires: + - start_utests_system_keyspace_directory + - j17_build diff --git a/.circleci/config_11_and_17.yml b/.circleci/config_11_and_17.yml index 2d0e77e6468e..036ca8a6e72c 100644 --- a/.circleci/config_11_and_17.yml +++ b/.circleci/config_11_and_17.yml @@ -21,10 +21,10 @@ jobs: j17_dtests: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -97,7 +97,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -156,7 +156,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -182,10 +182,10 @@ jobs: j17_cqlsh_dtests_py311_offheap: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -260,7 +260,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -289,7 +289,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -345,7 +345,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -374,7 +374,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -430,7 +430,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -489,7 +489,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -515,10 +515,10 @@ jobs: j17_cqlsh_dtests_py3_offheap: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -593,7 +593,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -622,7 +622,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -706,7 +706,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -732,10 +732,10 @@ jobs: j17_cqlsh_dtests_py38_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -810,7 +810,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -836,10 +836,10 @@ jobs: j17_dtests_vnode_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -960,7 +960,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -986,10 +986,10 @@ jobs: j17_dtests_offheap_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1088,7 +1088,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1114,10 +1114,10 @@ jobs: j11_dtests_vnode_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1216,7 +1216,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1245,7 +1245,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1329,7 +1329,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1355,10 +1355,10 @@ jobs: j17_cqlsh_dtests_py3: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -1433,7 +1433,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1462,7 +1462,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1518,7 +1518,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1547,7 +1547,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1631,7 +1631,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1660,7 +1660,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1716,7 +1716,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1742,10 +1742,10 @@ jobs: j11_cqlsh_dtests_py311: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -1820,7 +1820,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1846,10 +1846,10 @@ jobs: j17_dtests_large_vnode_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1948,7 +1948,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1974,10 +1974,10 @@ jobs: j17_dtests_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2098,7 +2098,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2127,7 +2127,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2211,7 +2211,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2237,10 +2237,10 @@ jobs: j17_cqlsh_dtests_py311: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -2315,7 +2315,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2341,10 +2341,10 @@ jobs: j11_cqlsh_dtests_py38: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -2419,7 +2419,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2448,7 +2448,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2504,7 +2504,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2533,7 +2533,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2589,7 +2589,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2618,7 +2618,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2779,7 +2779,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2805,7 +2805,7 @@ jobs: j11_dtests_large_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: xlarge working_directory: ~/ shell: /bin/bash -eo pipefail -l parallelism: 4 @@ -2859,7 +2859,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2885,10 +2885,10 @@ jobs: j11_dtests_large_vnode_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2987,7 +2987,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3016,7 +3016,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -3100,7 +3100,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3126,10 +3126,10 @@ jobs: j11_cqlsh_dtests_py38_offheap: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -3204,7 +3204,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3230,7 +3230,7 @@ jobs: j11_dtests_large: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: xlarge working_directory: ~/ shell: /bin/bash -eo pipefail -l parallelism: 4 @@ -3284,7 +3284,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3313,7 +3313,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -3369,7 +3369,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3395,10 +3395,10 @@ jobs: j17_jvm_dtests: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 10 steps: - attach_workspace: at: /home/cassandra @@ -3482,7 +3482,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3511,7 +3511,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -3672,7 +3672,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3698,10 +3698,10 @@ jobs: j11_cqlsh_dtests_py3: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -3776,7 +3776,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3878,7 +3878,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3907,7 +3907,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -3991,7 +3991,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4020,7 +4020,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -4076,7 +4076,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4143,7 +4143,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4169,10 +4169,10 @@ jobs: j11_dtests_offheap_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -4271,7 +4271,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4297,10 +4297,10 @@ jobs: j11_jvm_dtests_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 10 steps: - attach_workspace: at: /home/cassandra @@ -4384,7 +4384,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4451,7 +4451,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4480,7 +4480,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -4536,7 +4536,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4645,7 +4645,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4712,7 +4712,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4741,7 +4741,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -4797,7 +4797,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4823,10 +4823,10 @@ jobs: j17_dtests_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -4899,7 +4899,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4925,10 +4925,10 @@ jobs: j11_dtests_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -5027,7 +5027,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5056,7 +5056,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -5140,7 +5140,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5169,7 +5169,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -5225,7 +5225,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5251,10 +5251,10 @@ jobs: j11_cqlsh_dtests_py3_offheap: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -5329,7 +5329,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5355,10 +5355,10 @@ jobs: j11_cqlsh_dtests_py311_offheap: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -5433,7 +5433,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5462,7 +5462,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -5546,7 +5546,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5572,10 +5572,10 @@ jobs: j11_dtests_large_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -5674,7 +5674,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5703,7 +5703,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -5759,7 +5759,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5785,10 +5785,10 @@ jobs: j11_cqlsh_dtests_py3_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -5863,7 +5863,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5930,7 +5930,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5956,7 +5956,7 @@ jobs: j17_dtests_large_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: xlarge working_directory: ~/ shell: /bin/bash -eo pipefail -l parallelism: 4 @@ -6010,7 +6010,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6036,10 +6036,10 @@ jobs: j11_dtests_offheap: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -6090,7 +6090,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6116,10 +6116,10 @@ jobs: j11_cqlsh_dtests_py38_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -6194,7 +6194,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6223,7 +6223,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -6279,7 +6279,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6308,7 +6308,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -6364,7 +6364,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6393,7 +6393,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -6449,7 +6449,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6475,10 +6475,10 @@ jobs: j17_cqlsh_dtests_py38_offheap: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -6553,7 +6553,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6611,7 +6611,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6637,10 +6637,10 @@ jobs: j11_cqlsh_dtests_py311_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -6715,7 +6715,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6744,7 +6744,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -6828,7 +6828,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6854,10 +6854,10 @@ jobs: j17_cqlsh_dtests_py3_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -6932,7 +6932,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6958,10 +6958,10 @@ jobs: j17_cqlsh_dtests_py311_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -7036,7 +7036,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7062,10 +7062,10 @@ jobs: j11_jvm_dtests: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 10 steps: - attach_workspace: at: /home/cassandra @@ -7149,7 +7149,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7216,7 +7216,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7245,7 +7245,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -7301,7 +7301,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7403,7 +7403,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7461,7 +7461,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7487,10 +7487,10 @@ jobs: j11_dtests: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -7541,7 +7541,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7567,10 +7567,10 @@ jobs: j17_jvm_dtests_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 10 steps: - attach_workspace: at: /home/cassandra @@ -7654,7 +7654,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7680,10 +7680,10 @@ jobs: j17_cqlsh_dtests_py38: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -7758,7 +7758,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7787,7 +7787,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -7871,7 +7871,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7900,7 +7900,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -7956,7 +7956,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7982,7 +7982,7 @@ jobs: j17_dtests_large: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: xlarge working_directory: ~/ shell: /bin/bash -eo pipefail -l parallelism: 4 @@ -8036,7 +8036,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8065,7 +8065,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -8121,7 +8121,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8188,7 +8188,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8214,10 +8214,10 @@ jobs: j11_dtests_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -8268,7 +8268,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8297,7 +8297,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -8353,7 +8353,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8379,10 +8379,10 @@ jobs: j17_dtests_offheap: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 50 steps: - attach_workspace: at: /home/cassandra @@ -8455,7 +8455,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8481,10 +8481,10 @@ jobs: j17_dtests_large_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -8583,7 +8583,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8612,7 +8612,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -8668,7 +8668,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8697,7 +8697,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -8753,7 +8753,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.index.sai.disk.v1.trie.TrieValidationTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8791,6 +8791,12 @@ workflows: requires: - start_j11_unit_tests - j11_build + - start_j11_unit_tests_repeat: + type: approval + - j11_unit_tests_repeat: + requires: + - start_j11_unit_tests_repeat + - j11_build - start_j11_jvm_dtests: type: approval - j11_jvm_dtests: @@ -8851,6 +8857,12 @@ workflows: requires: - start_j17_unit_tests - j11_build + - start_j17_unit_tests_repeat: + type: approval + - j17_unit_tests_repeat: + requires: + - start_j17_unit_tests_repeat + - j11_build - start_j11_utests_long: type: approval - j11_utests_long: @@ -8875,6 +8887,18 @@ workflows: requires: - start_j17_utests_cdc - j11_build + - start_j11_utests_cdc_repeat: + type: approval + - j11_utests_cdc_repeat: + requires: + - start_j11_utests_cdc_repeat + - j11_build + - start_j17_utests_cdc_repeat: + type: approval + - j17_utests_cdc_repeat: + requires: + - start_j17_utests_cdc_repeat + - j11_build - start_j11_utests_compression: type: approval - j11_utests_compression: @@ -8887,6 +8911,18 @@ workflows: requires: - start_j17_utests_compression - j11_build + - start_j11_utests_compression_repeat: + type: approval + - j11_utests_compression_repeat: + requires: + - start_j11_utests_compression_repeat + - j11_build + - start_j17_utests_compression_repeat: + type: approval + - j17_utests_compression_repeat: + requires: + - start_j17_utests_compression_repeat + - j11_build - start_j11_utests_trie: type: approval - j11_utests_trie: @@ -8899,6 +8935,18 @@ workflows: requires: - start_j17_utests_trie - j11_build + - start_j11_utests_trie_repeat: + type: approval + - j11_utests_trie_repeat: + requires: + - start_j11_utests_trie_repeat + - j11_build + - start_j17_utests_trie_repeat: + type: approval + - j17_utests_trie_repeat: + requires: + - start_j17_utests_trie_repeat + - j11_build - start_j11_utests_stress: type: approval - j11_utests_stress: @@ -8935,6 +8983,18 @@ workflows: requires: - start_j17_utests_system_keyspace_directory - j11_build + - start_j11_utests_system_keyspace_directory_repeat: + type: approval + - j11_utests_system_keyspace_directory_repeat: + requires: + - start_j11_utests_system_keyspace_directory_repeat + - j11_build + - start_j17_utests_system_keyspace_directory_repeat: + type: approval + - j17_utests_system_keyspace_directory_repeat: + requires: + - start_j17_utests_system_keyspace_directory_repeat + - j11_build - start_j11_dtests: type: approval - j11_dtests: @@ -9085,6 +9145,9 @@ workflows: - j11_unit_tests: requires: - j11_build + - j11_unit_tests_repeat: + requires: + - j11_build - j11_simulator_dtests: requires: - j11_build @@ -9115,6 +9178,9 @@ workflows: - j17_unit_tests: requires: - j11_build + - j17_unit_tests_repeat: + requires: + - j11_build - start_utests_long: type: approval - j11_utests_long: @@ -9135,6 +9201,14 @@ workflows: requires: - start_utests_cdc - j11_build + - j11_utests_cdc_repeat: + requires: + - start_utests_cdc + - j11_build + - j17_utests_cdc_repeat: + requires: + - start_utests_cdc + - j11_build - start_utests_compression: type: approval - j11_utests_compression: @@ -9145,6 +9219,14 @@ workflows: requires: - start_utests_compression - j11_build + - j11_utests_compression_repeat: + requires: + - start_utests_compression + - j11_build + - j17_utests_compression_repeat: + requires: + - start_utests_compression + - j11_build - start_utests_trie: type: approval - j11_utests_trie: @@ -9155,6 +9237,14 @@ workflows: requires: - start_utests_trie - j11_build + - j11_utests_trie_repeat: + requires: + - start_utests_trie + - j11_build + - j17_utests_trie_repeat: + requires: + - start_utests_trie + - j11_build - start_utests_stress: type: approval - j11_utests_stress: @@ -9184,6 +9274,13 @@ workflows: requires: - start_utests_system_keyspace_directory - j11_build + - j11_utests_system_keyspace_directory_repeat: + requires: + - j11_build + - j17_utests_system_keyspace_directory_repeat: + requires: + - start_utests_system_keyspace_directory + - j11_build - j11_dtests: requires: - j11_build @@ -9305,6 +9402,12 @@ workflows: requires: - start_j17_unit_tests - j17_build + - start_j17_unit_tests_repeat: + type: approval + - j17_unit_tests_repeat: + requires: + - start_j17_unit_tests_repeat + - j17_build - start_j17_jvm_dtests: type: approval - j17_jvm_dtests: @@ -9411,18 +9514,36 @@ workflows: requires: - start_j17_utests_cdc - j17_build + - start_j17_utests_cdc_repeat: + type: approval + - j17_utests_cdc_repeat: + requires: + - start_j17_utests_cdc_repeat + - j17_build - start_j17_utests_compression: type: approval - j17_utests_compression: requires: - start_j17_utests_compression - j17_build + - start_j17_utests_compression_repeat: + type: approval + - j17_utests_compression_repeat: + requires: + - start_j17_utests_compression_repeat + - j17_build - start_j17_utests_trie: type: approval - j17_utests_trie: requires: - start_j17_utests_trie - j17_build + - start_j17_utests_trie_repeat: + type: approval + - j17_utests_trie_repeat: + requires: + - start_j17_utests_trie_repeat + - j17_build - start_j17_utests_stress: type: approval - j17_utests_stress: @@ -9441,6 +9562,12 @@ workflows: requires: - start_j17_utests_system_keyspace_directory - j17_build + - start_j17_utests_system_keyspace_directory_repeat: + type: approval + - j17_utests_system_keyspace_directory_repeat: + requires: + - start_j17_utests_system_keyspace_directory_repeat + - j17_build java17_pre-commit_tests: jobs: - start_pre-commit_tests: @@ -9451,6 +9578,9 @@ workflows: - j17_unit_tests: requires: - j17_build + - j17_unit_tests_repeat: + requires: + - j17_build - j17_jvm_dtests: requires: - j17_build @@ -9529,18 +9659,30 @@ workflows: requires: - start_utests_cdc - j17_build + - j17_utests_cdc_repeat: + requires: + - start_utests_cdc + - j17_build - start_utests_compression: type: approval - j17_utests_compression: requires: - start_utests_compression - j17_build + - j17_utests_compression_repeat: + requires: + - start_utests_compression + - j17_build - start_utests_trie: type: approval - j17_utests_trie: requires: - start_utests_trie - j17_build + - j17_utests_trie_repeat: + requires: + - start_utests_trie + - j17_build - start_utests_stress: type: approval - j17_utests_stress: @@ -9559,3 +9701,7 @@ workflows: requires: - start_utests_system_keyspace_directory - j17_build + - j17_utests_system_keyspace_directory_repeat: + requires: + - start_utests_system_keyspace_directory + - j17_build diff --git a/.circleci/generate_11_and_17.sh b/.circleci/generate_11_and_17.sh index c09723abcbf8..0572fd049623 100755 --- a/.circleci/generate_11_and_17.sh +++ b/.circleci/generate_11_and_17.sh @@ -18,7 +18,7 @@ # BASEDIR=`dirname $0` -BASE_BRANCH=trunk +BASE_BRANCH=cep-7-sai set -e die () diff --git a/src/java/org/apache/cassandra/index/sai/IndexContext.java b/src/java/org/apache/cassandra/index/sai/IndexContext.java index 8bdd825f8654..3e18afe34622 100644 --- a/src/java/org/apache/cassandra/index/sai/IndexContext.java +++ b/src/java/org/apache/cassandra/index/sai/IndexContext.java @@ -162,9 +162,9 @@ public IndexMetadata getIndexMetadata() /** * @return A set of SSTables which have attached to them invalid index components. */ - public Collection onSSTableChanged(Collection oldSSTables, Collection newSSTables, boolean validate) + public Collection onSSTableChanged(Collection oldSSTables, Collection newSSTables, IndexValidation validation) { - return viewManager.update(oldSSTables, newSSTables, validate); + return viewManager.update(oldSSTables, newSSTables, validation); } public ColumnMetadata getDefinition() @@ -408,7 +408,7 @@ public String logMessage(String message) * @return the indexes that are built on the given SSTables on the left and corrupted indexes' * corresponding contexts on the right */ - public Pair, Collection> getBuiltIndexes(Collection sstableContexts, boolean validate) + public Pair, Collection> getBuiltIndexes(Collection sstableContexts, IndexValidation validation) { Set valid = new HashSet<>(sstableContexts.size()); Set invalid = new HashSet<>(); @@ -433,9 +433,9 @@ public Pair, Collection> getBuiltIndexe try { - if (validate) + if (validation != IndexValidation.NONE) { - if (!sstableContext.indexDescriptor.validatePerIndexComponents(this)) + if (!sstableContext.indexDescriptor.validatePerIndexComponents(this, validation)) { logger.warn(logMessage("Invalid per-column component for SSTable {}"), sstableContext.descriptor()); invalid.add(sstableContext); diff --git a/src/java/org/apache/cassandra/index/sai/IndexValidation.java b/src/java/org/apache/cassandra/index/sai/IndexValidation.java new file mode 100644 index 000000000000..edd9e0fd1c0a --- /dev/null +++ b/src/java/org/apache/cassandra/index/sai/IndexValidation.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.cassandra.index.sai; + +public enum IndexValidation +{ + /** + * No validation to be performed + */ + NONE, + + /** + * Basic header/footer validation, but no data validation (fast) + */ + HEADER_FOOTER, + + /** + * Full validation with checksumming data (slow) + */ + CHECKSUM + +} diff --git a/src/java/org/apache/cassandra/index/sai/SSTableContextManager.java b/src/java/org/apache/cassandra/index/sai/SSTableContextManager.java index ba65806e86a1..85192f525e43 100644 --- a/src/java/org/apache/cassandra/index/sai/SSTableContextManager.java +++ b/src/java/org/apache/cassandra/index/sai/SSTableContextManager.java @@ -47,12 +47,12 @@ public class SSTableContextManager * * @param removed SSTables being removed * @param added SSTables being added - * @param validate if true, header and footer will be validated. + * @param validation Controls how indexes should be validated * * @return a set of contexts for SSTables with valid per-SSTable components, and a set of * SSTables with invalid or missing components */ - public Pair, Set> update(Collection removed, Iterable added, boolean validate) + public Pair, Set> update(Collection removed, Iterable added, IndexValidation validation) { release(removed); @@ -77,7 +77,7 @@ public Pair, Set> update(Collection getInitializationTask() // New storage-attached indexes will be available for queries after on disk index data are built. // Memtable data will be indexed via flushing triggered by schema change // We only want to validate the index files if we are starting up - return () -> startInitialBuild(baseCfs, StorageService.instance.isStarting()).get(); + IndexValidation validation = StorageService.instance.isStarting() ? IndexValidation.HEADER_FOOTER : IndexValidation.NONE; + return () -> startInitialBuild(baseCfs, validation).get(); } - private Future startInitialBuild(ColumnFamilyStore baseCfs, boolean validate) + private Future startInitialBuild(ColumnFamilyStore baseCfs, IndexValidation validation) { if (baseCfs.indexManager.isIndexQueryable(this)) { @@ -303,7 +304,7 @@ private Future startInitialBuild(ColumnFamilyStore baseCfs, boolean validate) assert indexGroup != null : "Index group does not exist for table " + baseCfs.keyspace + '.' + baseCfs.name; - List nonIndexed = findNonIndexedSSTables(baseCfs, indexGroup, validate); + List nonIndexed = findNonIndexedSSTables(baseCfs, indexGroup, validation); if (nonIndexed.isEmpty()) { @@ -430,7 +431,7 @@ private Future startPreJoinTask() assert indexGroup != null : "Index group does not exist for table"; - Collection nonIndexed = findNonIndexedSSTables(baseCfs, indexGroup, true); + Collection nonIndexed = findNonIndexedSSTables(baseCfs, indexGroup, IndexValidation.HEADER_FOOTER); if (nonIndexed.isEmpty()) { @@ -522,13 +523,13 @@ public void validate(PartitionUpdate update) throws InvalidRequestException * * @return a list SSTables without attached indexes */ - private synchronized List findNonIndexedSSTables(ColumnFamilyStore baseCfs, StorageAttachedIndexGroup group, boolean validate) + private synchronized List findNonIndexedSSTables(ColumnFamilyStore baseCfs, StorageAttachedIndexGroup group, IndexValidation validation) { Set sstables = baseCfs.getLiveSSTables(); // Initialize the SSTable indexes w/ valid existing components... assert group != null : "Missing index group on " + baseCfs.name; - group.onSSTableChanged(Collections.emptyList(), sstables, Collections.singleton(this), validate); + group.onSSTableChanged(Collections.emptyList(), sstables, Collections.singleton(this), validation); // ...then identify and rebuild the SSTable indexes that are missing. List nonIndexed = new ArrayList<>(); diff --git a/src/java/org/apache/cassandra/index/sai/StorageAttachedIndexBuilder.java b/src/java/org/apache/cassandra/index/sai/StorageAttachedIndexBuilder.java index 8908b83df068..a5ee5910b069 100644 --- a/src/java/org/apache/cassandra/index/sai/StorageAttachedIndexBuilder.java +++ b/src/java/org/apache/cassandra/index/sai/StorageAttachedIndexBuilder.java @@ -261,8 +261,9 @@ private CountDownLatch shouldWritePerSSTableFiles(SSTableReader sstable) { // if per-table files are incomplete or checksum failed during full rebuild. IndexDescriptor indexDescriptor = IndexDescriptor.create(sstable); - if (!indexDescriptor.isPerSSTableIndexBuildComplete() || - (isFullRebuild && !indexDescriptor.validatePerSSTableComponentsChecksum())) + if (!indexDescriptor.isPerSSTableIndexBuildComplete() + || isFullRebuild + || !indexDescriptor.validatePerSSTableComponents(IndexValidation.CHECKSUM)) { CountDownLatch latch = CountDownLatch.newCountDownLatch(1); if (inProgress.putIfAbsent(sstable, latch) == null) @@ -307,7 +308,7 @@ private void completeSSTable(SSTableFlushObserver indexWriter, // register custom index components into existing sstables sstable.registerComponents(StorageAttachedIndexGroup.getLiveComponents(sstable, existing), tracker); - Set incomplete = group.onSSTableChanged(Collections.emptyList(), Collections.singleton(sstable), existing, false); + Set incomplete = group.onSSTableChanged(Collections.emptyList(), Collections.singleton(sstable), existing, IndexValidation.NONE); if (!incomplete.isEmpty()) { diff --git a/src/java/org/apache/cassandra/index/sai/StorageAttachedIndexGroup.java b/src/java/org/apache/cassandra/index/sai/StorageAttachedIndexGroup.java index 0c98f2320a87..c3d2c63c1dd2 100644 --- a/src/java/org/apache/cassandra/index/sai/StorageAttachedIndexGroup.java +++ b/src/java/org/apache/cassandra/index/sai/StorageAttachedIndexGroup.java @@ -250,7 +250,7 @@ public void handleNotification(INotification notification, Object sender) SSTableAddedNotification notice = (SSTableAddedNotification) notification; // Avoid validation for index files just written following Memtable flush. - boolean validate = !notice.memtable().isPresent(); + IndexValidation validate = notice.memtable().isPresent() ? IndexValidation.NONE : IndexValidation.CHECKSUM; onSSTableChanged(Collections.emptySet(), notice.added, indexes, validate); } else if (notification instanceof SSTableListChangedNotification) @@ -258,7 +258,7 @@ else if (notification instanceof SSTableListChangedNotification) SSTableListChangedNotification notice = (SSTableListChangedNotification) notification; // Avoid validation for index files just written during compaction. - onSSTableChanged(notice.removed, notice.added, indexes, false); + onSSTableChanged(notice.removed, notice.added, indexes, IndexValidation.NONE); } else if (notification instanceof MemtableRenewedNotification) { @@ -298,9 +298,9 @@ void dropIndexSSTables(Collection ss, StorageAttachedIndex index) * files being corrupt or being unable to successfully update their views */ synchronized Set onSSTableChanged(Collection removed, Iterable added, - Set indexes, boolean validate) + Set indexes, IndexValidation validation) { - Pair, Set> results = contextManager.update(removed, added, validate); + Pair, Set> results = contextManager.update(removed, added, validation); if (!results.right.isEmpty()) { @@ -321,7 +321,7 @@ synchronized Set onSSTableChanged(Collection invalid = index.getIndexContext().onSSTableChanged(removed, results.left, validate); + Collection invalid = index.getIndexContext().onSSTableChanged(removed, results.left, validation); if (!invalid.isEmpty()) { @@ -410,8 +410,8 @@ public SSTableContextManager sstableContextManager() public void unsafeReload() { contextManager.clear(); - onSSTableChanged(baseCfs.getLiveSSTables(), Collections.emptySet(), indexes, false); - onSSTableChanged(Collections.emptySet(), baseCfs.getLiveSSTables(), indexes, true); + onSSTableChanged(baseCfs.getLiveSSTables(), Collections.emptySet(), indexes, IndexValidation.NONE); + onSSTableChanged(Collections.emptySet(), baseCfs.getLiveSSTables(), indexes, IndexValidation.HEADER_FOOTER); } /** @@ -422,6 +422,6 @@ public void reset() { contextManager.clear(); indexes.forEach(StorageAttachedIndex::makeIndexNonQueryable); - onSSTableChanged(baseCfs.getLiveSSTables(), Collections.emptySet(), indexes, false); + onSSTableChanged(baseCfs.getLiveSSTables(), Collections.emptySet(), indexes, IndexValidation.NONE); } } diff --git a/src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java b/src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java index 7261671ecaed..5aa2a985d503 100644 --- a/src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java +++ b/src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java @@ -31,6 +31,7 @@ import org.apache.cassandra.db.ClusteringComparator; import org.apache.cassandra.db.lifecycle.LifecycleNewTracker; import org.apache.cassandra.index.sai.IndexContext; +import org.apache.cassandra.index.sai.IndexValidation; import org.apache.cassandra.index.sai.SSTableContext; import org.apache.cassandra.index.sai.StorageAttachedIndex; import org.apache.cassandra.index.sai.disk.PerColumnIndexWriter; @@ -327,28 +328,25 @@ public long sizeOnDiskOfPerIndexComponent(IndexComponent indexComponent, IndexCo } @SuppressWarnings("BooleanMethodIsAlwaysInverted") - public boolean validatePerIndexComponents(IndexContext indexContext) + public boolean validatePerIndexComponents(IndexContext indexContext, IndexValidation validation) { - logger.info(indexContext.logMessage("Validating per-column index components")); - return version.onDiskFormat().validatePerColumnIndexComponents(this, indexContext, false); - } + if (validation == IndexValidation.NONE) + return true; - @VisibleForTesting - public boolean validatePerIndexComponentsChecksum(IndexContext indexContext) - { - return version.onDiskFormat().validatePerColumnIndexComponents(this, indexContext, true); + logger.info(indexContext.logMessage("Validating per-column index components using mode " + validation)); + boolean checksum = validation == IndexValidation.CHECKSUM; + return version.onDiskFormat().validatePerColumnIndexComponents(this, indexContext, checksum); } @SuppressWarnings("BooleanMethodIsAlwaysInverted") - public boolean validatePerSSTableComponents() + public boolean validatePerSSTableComponents(IndexValidation validation) { - return version.onDiskFormat().validatePerSSTableIndexComponents(this, false); - } + if (validation == IndexValidation.NONE) + return true; - @SuppressWarnings("BooleanMethodIsAlwaysInverted") - public boolean validatePerSSTableComponentsChecksum() - { - return version.onDiskFormat().validatePerSSTableIndexComponents(this, true); + logger.info(logMessage("Validating per-sstable index components using mode " + validation)); + boolean checksum = validation == IndexValidation.CHECKSUM; + return version.onDiskFormat().validatePerSSTableIndexComponents(this, checksum); } public void deletePerSSTableIndexComponents() diff --git a/src/java/org/apache/cassandra/index/sai/disk/io/IndexFileUtils.java b/src/java/org/apache/cassandra/index/sai/disk/io/IndexFileUtils.java index 1394d2055594..6cf91752479c 100644 --- a/src/java/org/apache/cassandra/index/sai/disk/io/IndexFileUtils.java +++ b/src/java/org/apache/cassandra/index/sai/disk/io/IndexFileUtils.java @@ -19,7 +19,7 @@ package org.apache.cassandra.index.sai.disk.io; import java.io.IOException; -import java.nio.ByteOrder; +import java.nio.ByteBuffer; import java.util.zip.CRC32; import com.google.common.annotations.VisibleForTesting; @@ -58,7 +58,7 @@ public IndexOutputWriter openOutput(File file) { assert writerOption.finishOnClose() : "IndexOutputWriter relies on close() to sync with disk."; - return new IndexOutputWriter(new IncrementalChecksumSequentialWriter(file, writerOption)); + return new IndexOutputWriter(new ChecksummingWriter(file, writerOption)); } public IndexInput openInput(FileHandle handle) @@ -75,74 +75,27 @@ public IndexInput openBlockingInput(File file) return IndexInputReader.create(randomReader, fileHandle::close); } - public interface ChecksumWriter - { - long getChecksum(); - } - - static class IncrementalChecksumSequentialWriter extends SequentialWriter implements ChecksumWriter + static class ChecksummingWriter extends SequentialWriter { private final CRC32 checksum = new CRC32(); - IncrementalChecksumSequentialWriter(File file, SequentialWriterOption writerOption) + ChecksummingWriter(File file, SequentialWriterOption writerOption) { super(file, writerOption); } - @Override - public void writeByte(int b) throws IOException - { - super.writeByte(b); - checksum.update(b); - } - - @Override - public void write(byte[] b) throws IOException - { - super.write(b); - checksum.update(b); - } - - @Override - public void write(byte[] b, int off, int len) throws IOException - { - super.write(b, off, len); - checksum.update(b, off, len); - } - - @Override - public void writeChar(int v) throws IOException - { - super.writeChar(v); - addTochecksum(v, 2); - } - - @Override - public void writeInt(int v) throws IOException - { - super.writeInt(v); - addTochecksum(v, 4); - } - - @Override - public void writeLong(long v) throws IOException - { - super.writeLong(v); - addTochecksum(v, 8); - } - - public long getChecksum() + public long getChecksum() throws IOException { + flush(); return checksum.getValue(); } - private void addTochecksum(long bytes, int count) + @Override + protected void flushData() { - int origCount = count; - if (ByteOrder.BIG_ENDIAN == buffer.order()) - while (count > 0) checksum.update((int) (bytes >>> (8 * --count))); - else - while (count > 0) checksum.update((int) (bytes >>> (8 * (origCount - count--)))); + ByteBuffer toAppend = buffer.duplicate().flip(); + super.flushData(); + checksum.update(toAppend); } } } diff --git a/src/java/org/apache/cassandra/index/sai/disk/io/IndexOutputWriter.java b/src/java/org/apache/cassandra/index/sai/disk/io/IndexOutputWriter.java index 29c4e606251e..4e801011da2c 100644 --- a/src/java/org/apache/cassandra/index/sai/disk/io/IndexOutputWriter.java +++ b/src/java/org/apache/cassandra/index/sai/disk/io/IndexOutputWriter.java @@ -62,9 +62,9 @@ public File getFile() } @Override - public long getChecksum() + public long getChecksum() throws IOException { - return ((IndexFileUtils.ChecksumWriter)out).getChecksum(); + return ((IndexFileUtils.ChecksummingWriter)out).getChecksum(); } @Override @@ -106,10 +106,16 @@ public void close() @Override public String toString() { + String checksum; + try { + checksum = String.valueOf(getChecksum()); + } catch (IOException e) { + checksum = "unknown due to I/O error: " + e; + } return MoreObjects.toStringHelper(this) .add("path", out.getPath()) .add("bytesWritten", getFilePointer()) - .add("crc", getChecksum()) + .add("crc", checksum) .toString(); } diff --git a/src/java/org/apache/cassandra/index/sai/disk/v1/V1OnDiskFormat.java b/src/java/org/apache/cassandra/index/sai/disk/v1/V1OnDiskFormat.java index 830712b45fe5..763e1af102c8 100644 --- a/src/java/org/apache/cassandra/index/sai/disk/v1/V1OnDiskFormat.java +++ b/src/java/org/apache/cassandra/index/sai/disk/v1/V1OnDiskFormat.java @@ -176,14 +176,11 @@ public boolean validatePerSSTableIndexComponents(IndexDescriptor indexDescriptor } catch (Throwable e) { - if (logger.isDebugEnabled()) - { - logger.debug(indexDescriptor.logMessage("{} failed for index component {} on SSTable {}. Error: {}"), - checksum ? "Checksum validation" : "Validation", - indexComponent, - indexDescriptor.sstableDescriptor, - e); - } + logger.error(indexDescriptor.logMessage("{} failed for index component {} on SSTable {}. Error: {}"), + checksum ? "Checksum validation" : "Validation", + indexComponent, + indexDescriptor.sstableDescriptor, + e); return false; } } diff --git a/src/java/org/apache/cassandra/index/sai/view/IndexViewManager.java b/src/java/org/apache/cassandra/index/sai/view/IndexViewManager.java index e49230dcb9e3..72912d52eb6f 100644 --- a/src/java/org/apache/cassandra/index/sai/view/IndexViewManager.java +++ b/src/java/org/apache/cassandra/index/sai/view/IndexViewManager.java @@ -29,6 +29,7 @@ import org.slf4j.LoggerFactory; import org.apache.cassandra.index.sai.IndexContext; +import org.apache.cassandra.index.sai.IndexValidation; import org.apache.cassandra.index.sai.SSTableContext; import org.apache.cassandra.index.sai.disk.SSTableIndex; import org.apache.cassandra.index.sai.StorageAttachedIndexGroup; @@ -64,14 +65,14 @@ public View getView() * * @param oldSSTables A set of SSTables to remove. * @param newSSTableContexts A set of SSTableContexts to add to tracker. - * @param validate if true, per-column index files' header and footer will be validated. + * @param validation Controls how indexes should be validated * * @return A set of SSTables which have attached to them invalid index components. */ - public Collection update(Collection oldSSTables, Collection newSSTableContexts, boolean validate) + public Collection update(Collection oldSSTables, Collection newSSTableContexts, IndexValidation validation) { // Valid indexes on the left and invalid SSTable contexts on the right... - Pair, Collection> indexes = context.getBuiltIndexes(newSSTableContexts, validate); + Pair, Collection> indexes = context.getBuiltIndexes(newSSTableContexts, validation); View currentView, newView; Collection newViewIndexes = new HashSet<>(); @@ -129,7 +130,7 @@ public void drop(Collection sstablesToRebuild) index.markObsolete(); } - update(toRemove, Collections.emptyList(), false); + update(toRemove, Collections.emptyList(), IndexValidation.NONE); } /** diff --git a/test/unit/org/apache/cassandra/index/sai/SAITester.java b/test/unit/org/apache/cassandra/index/sai/SAITester.java index 133a4bfc7ab9..de302409cb86 100644 --- a/test/unit/org/apache/cassandra/index/sai/SAITester.java +++ b/test/unit/org/apache/cassandra/index/sai/SAITester.java @@ -75,6 +75,7 @@ import org.apache.cassandra.index.sai.disk.SSTableIndex; import org.apache.cassandra.index.sai.disk.format.IndexComponent; import org.apache.cassandra.index.sai.disk.format.IndexDescriptor; +import org.apache.cassandra.index.sai.disk.format.OnDiskFormat; import org.apache.cassandra.index.sai.disk.format.Version; import org.apache.cassandra.index.sai.disk.v1.V1OnDiskFormat; import org.apache.cassandra.index.sai.disk.v1.segment.SegmentBuilder; @@ -127,13 +128,13 @@ public abstract class SAITester extends CQLTester .build(); protected static final Injections.Counter perSSTableValidationCounter = Injections.newCounter("PerSSTableValidationCounter") - .add(newInvokePoint().onClass(IndexDescriptor.class) - .onMethod("validatePerSSTableComponents")) + .add(newInvokePoint().onClass(OnDiskFormat.class) + .onMethod("validatePerSSTableIndexComponents")) .build(); protected static final Injections.Counter perColumnValidationCounter = Injections.newCounter("PerColumnValidationCounter") - .add(newInvokePoint().onClass(IndexDescriptor.class) - .onMethod("validatePerIndexComponents")) + .add(newInvokePoint().onClass(OnDiskFormat.class) + .onMethod("validatePerColumnIndexComponents")) .build(); private static Randomization random; @@ -320,7 +321,8 @@ protected boolean verifyChecksum(IndexContext indexContext) for (SSTableReader sstable : cfs.getLiveSSTables()) { IndexDescriptor indexDescriptor = IndexDescriptor.create(sstable); - if (!indexDescriptor.validatePerSSTableComponentsChecksum() || !indexDescriptor.validatePerIndexComponentsChecksum(indexContext)) + if (!indexDescriptor.validatePerSSTableComponents(IndexValidation.CHECKSUM) + || !indexDescriptor.validatePerIndexComponents(indexContext, IndexValidation.CHECKSUM)) return false; } return true; @@ -333,7 +335,8 @@ protected boolean validateComponents(IndexContext indexContext) for (SSTableReader sstable : cfs.getLiveSSTables()) { IndexDescriptor indexDescriptor = IndexDescriptor.create(sstable); - if (!indexDescriptor.validatePerSSTableComponents() || !indexDescriptor.validatePerIndexComponents(indexContext)) + if (!indexDescriptor.validatePerSSTableComponents(IndexValidation.HEADER_FOOTER) + || !indexDescriptor.validatePerIndexComponents(indexContext, IndexValidation.HEADER_FOOTER)) return false; } return true; diff --git a/test/unit/org/apache/cassandra/index/sai/disk/v1/trie/TrieValidationTest.java b/test/unit/org/apache/cassandra/index/sai/disk/v1/trie/TrieValidationTest.java new file mode 100644 index 000000000000..f7378077a9ef --- /dev/null +++ b/test/unit/org/apache/cassandra/index/sai/disk/v1/trie/TrieValidationTest.java @@ -0,0 +1,93 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.cassandra.index.sai.disk.v1.trie; + +import org.junit.Before; +import org.junit.Test; + +import org.apache.cassandra.db.marshal.UTF8Type; +import org.apache.cassandra.index.sai.disk.format.IndexComponent; +import org.apache.cassandra.index.sai.disk.format.IndexDescriptor; +import org.apache.cassandra.index.sai.disk.io.IndexOutputWriter; +import org.apache.cassandra.index.sai.disk.v1.SAICodecUtils; +import org.apache.cassandra.index.sai.utils.SAIRandomizedTester; +import org.apache.cassandra.io.tries.IncrementalDeepTrieWriterPageAware; +import org.apache.cassandra.utils.bytecomparable.ByteComparable; +import org.apache.cassandra.utils.bytecomparable.ByteSource; +import org.apache.lucene.store.IndexInput; + +import static org.apache.cassandra.index.sai.disk.v1.trie.TrieTermsDictionaryReader.trieSerializer; + +public class TrieValidationTest extends SAIRandomizedTester +{ + private IndexDescriptor indexDescriptor; + + @Before + public void createIndexDescriptor() throws Throwable + { + indexDescriptor = newIndexDescriptor(); + } + + @Test + public void testHeaderValidation() throws Throwable + { + createSimpleTrie(indexDescriptor); + try (IndexInput input = indexDescriptor.openPerSSTableInput(IndexComponent.PRIMARY_KEY_TRIE)) + { + SAICodecUtils.validate(input); + } + } + + @Test + public void testChecksumValidation() throws Throwable + { + createSimpleTrie(indexDescriptor); + try (IndexInput input = indexDescriptor.openPerSSTableInput(IndexComponent.PRIMARY_KEY_TRIE)) + { + SAICodecUtils.validateChecksum(input); + } + } + + private static void createSimpleTrie(IndexDescriptor indexDescriptor) throws Throwable + { + try (IndexOutputWriter trieOutput = indexDescriptor.openPerSSTableOutput(IndexComponent.PRIMARY_KEY_TRIE); + IncrementalDeepTrieWriterPageAware trieWriter = new IncrementalDeepTrieWriterPageAware<>(trieSerializer, trieOutput.asSequentialWriter())) + { + SAICodecUtils.writeHeader(trieOutput); + trieWriter.add(v -> createMultiPart(v, "abc", "def", "ghi"), 1L); + trieWriter.add(v -> createMultiPart(v, "abc", "def", "jkl"), 2L); + trieWriter.add(v -> createMultiPart(v, "abc", "ghi", "jkl"), 3L); + trieWriter.add(v -> createMultiPart(v, "def", "ghi", "jkl"), 4L); + trieWriter.add(v -> UTF8Type.instance.asComparableBytes(UTF8Type.instance.fromString("abcdef"), v), 5L); + trieWriter.add(v -> UTF8Type.instance.asComparableBytes(UTF8Type.instance.fromString("abdefg"), v), 6L); + trieWriter.add(v -> UTF8Type.instance.asComparableBytes(UTF8Type.instance.fromString("abdfgh"), v), 7L); + trieWriter.complete(); + SAICodecUtils.writeFooter(trieOutput); + } + } + + private static ByteSource createMultiPart(ByteComparable.Version version, String... parts) + { + ByteSource [] byteSources = new ByteSource[parts.length]; + for (int index = 0; index < parts.length; index++) + byteSources[index] = UTF8Type.instance.asComparableBytes(UTF8Type.instance.fromString(parts[index]), version); + return ByteSource.withTerminator(ByteSource.TERMINATOR, byteSources); + } + +}