This is an automated email from the ASF dual-hosted git repository. bdeggleston pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/trunk by this push: new aa762c6 Support building Cassandra with JDK 11 aa762c6 is described below commit aa762c6d5253e0cc2947d3bf2b6149197e106036 Author: Blake Eggleston <bdeggles...@gmail.com> AuthorDate: Tue Mar 26 11:18:00 2019 -0700 Support building Cassandra with JDK 11 Patch by Blake Eggleston; Reviewed by Dinesh Joshi and Sam Tunnicliffe for CASSANDRA-15108 --- .circleci/config-2_1.yml | 243 +++--- .circleci/config.yml | 890 +++++---------------- .circleci/config.yml.HIGHRES | 890 +++++---------------- .circleci/config.yml.LOWRES | 890 +++++---------------- CHANGES.txt | 1 + build.xml | 200 +++-- conf/jvm11-clients.options | 10 +- conf/jvm11-server.options | 10 +- lib/asm-6.2.jar | Bin 111214 -> 0 bytes lib/asm-7.1.jar | Bin 0 -> 114762 bytes .../cql3/functions/UDFByteCodeVerifier.java | 2 +- .../apache/cassandra/metrics/StreamingMetrics.java | 18 +- 12 files changed, 909 insertions(+), 2245 deletions(-) diff --git a/.circleci/config-2_1.yml b/.circleci/config-2_1.yml index a4cf55f..d0bd003 100644 --- a/.circleci/config-2_1.yml +++ b/.circleci/config-2_1.yml @@ -1,8 +1,6 @@ version: 2.1 default_env_vars: &default_env_vars - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 ANT_HOME: /usr/share/ant LANG: en_US.UTF-8 KEEP_TEST_DIR: true @@ -36,98 +34,133 @@ j11_par_executor: &j11_par_executor #exec_resource_class: xlarge parallelism: 4 -with_dtests_jobs: &with_dtest_jobs +j8_with_dtests_jobs: &j8_with_dtests_jobs + jobs: + - j8_build + # Java 8 unit tests will be run automatically + - j8_unit_tests: + requires: + - j8_build + - j8_jvm_dtests: + requires: + - j8_build + # Java 11 unit tests (on request, currently not working) + - start_j11_unit_tests: + type: approval + requires: + - j8_build + - j11_unit_tests: + requires: + - start_j11_unit_tests + # specialized unit tests (all run on request using Java 8) + - start_utests_long: + type: approval + requires: + - j8_build + - utests_long: + requires: + - start_utests_long + - start_utests_compression: + type: approval + requires: + - j8_build + - utests_compression: + requires: + - start_utests_compression + - start_utests_stress: + type: approval + requires: + - j8_build + - utests_stress: + requires: + - start_utests_stress + - start_utests_fqltool: + type: approval + requires: + - j8_build + - utests_fqltool: + requires: + - start_utests_fqltool + # Java 8 dtests (on request) + - start_j8_dtests: + type: approval + requires: + - j8_build + - j8_dtests-with-vnodes: + requires: + - start_j8_dtests + - j8_dtests-no-vnodes: + requires: + - start_j8_dtests + # Java 11 dtests (on request) + - start_j11_dtests: + type: approval + requires: + - j8_build + - j11_dtests-with-vnodes: + requires: + - start_j11_dtests + - j11_dtests-no-vnodes: + requires: + - start_j11_dtests + # Java 8 upgrade tests + - start_upgrade_tests: + type: approval + requires: + - j8_build + - j8_upgradetests-no-vnodes: + requires: + - start_upgrade_tests + +j11_with_dtests_jobs: &j11_with_dtests_jobs + jobs: + - j11_build + # Java 11 unit tests (on request, currently not working) + - start_j11_unit_tests: + type: approval + requires: + - j11_build + - j11_unit_tests: + requires: + - start_j11_unit_tests + # Java 11 dtests (on request) + - start_j11_dtests: + type: approval + requires: + - j11_build + - j11_dtests-with-vnodes: + requires: + - start_j11_dtests + - j11_dtests-no-vnodes: + requires: + - start_j11_dtests + +j8_with_dtest_jobs_only: &j8_with_dtest_jobs_only jobs: - - build - # Java 8 unit tests will be run automatically - - j8_unit_tests: - requires: - - build - - j8_jvm_dtests: - requires: - - build - # Java 11 unit tests (on request, currently not working) - - start_j11_unit_tests: - type: approval - requires: - - build - - j11_unit_tests: - requires: - - start_j11_unit_tests - # specialized unit tests (all run on request using Java 8) - - start_utests_long: - type: approval - requires: - - build - - utests_long: - requires: - - start_utests_long - - start_utests_compression: - type: approval - requires: - - build - - utests_compression: - requires: - - start_utests_compression - - start_utests_stress: - type: approval - requires: - - build - - utests_stress: - requires: - - start_utests_stress - - start_utests_fqltool: - type: approval - requires: - - build - - utests_fqltool: - requires: - - start_utests_fqltool - # Java 8 dtests (on request) - - start_j8_dtests: - type: approval - requires: - - build + - j8_build - j8_dtests-with-vnodes: - requires: - - start_j8_dtests + requires: + - j8_build - j8_dtests-no-vnodes: - requires: - - start_j8_dtests - # Java 11 dtests (on request) - - start_j11_dtests: - type: approval - requires: - - build - - j11_dtests-with-vnodes: - requires: - - start_j11_dtests - - j11_dtests-no-vnodes: - requires: - - start_j11_dtests - # Java 8 upgrade tests - - start_upgrade_tests: - type: approval - requires: - - build - - j8_upgradetests-no-vnodes: - requires: - - start_upgrade_tests + requires: + - j8_build -with_dtest_jobs_only: &with_dtest_jobs_only +j11_with_dtest_jobs_only: &j11_with_dtest_jobs_only jobs: - build - - j8_dtests-with-vnodes: - requires: - - build - - j8_dtests-no-vnodes: - requires: - - build + - j11-with-vnodes: + requires: + - j11_build + - j11_dtests-no-vnodes: + requires: + - j11_build workflows: version: 2 - build_and_run_tests: *with_dtest_jobs - #build_and_run_tests: *with_dtest_jobs_only + java8_build_and_run_tests: *j8_with_dtests_jobs +# java8_build_and_run_tests: *j8_with_dtest_jobs_only + java11_build_and_run_tests: *j11_with_dtests_jobs +# java11_build_and_run_tests: *j11_with_dtest_jobs_only executors: java8-executor: @@ -159,21 +192,29 @@ executors: <<: *default_env_vars JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + CASSANDRA_USE_JDK11: true + +build_common: &build_common + parallelism: 1 # This job doesn't benefit from parallelism + steps: + - log_environment + - clone_cassandra + - build_cassandra + - run_eclipse_warnings + - persist_to_workspace: + root: /home/cassandra + paths: + - cassandra + - .m2 jobs: - build: + j8_build: + executor: java8-executor + <<: *build_common + + j11_build: executor: java11-executor - parallelism: 1 # This job doesn't benefit from parallelism - steps: - - log_environment - - clone_cassandra - - build_cassandra - - run_eclipse_warnings - - persist_to_workspace: - root: /home/cassandra - paths: - - cassandra - - .m2 + <<: *build_common j8_unit_tests: <<: *j8_par_executor @@ -359,7 +400,7 @@ commands: 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 jar + ${ANT_HOME}/bin/ant clean realclean jar RETURN="$?" if [ "${RETURN}" -eq "0" ]; then break @@ -414,13 +455,11 @@ commands: steps: - run: name: Run Unit Tests (<<parameters.target>>) - # Please note that we run `clean` and therefore rebuild the project, as we can't run tests on Java 8 in case - # based on Java 11 builds. command: | export PATH=$JAVA_HOME/bin:$PATH time mv ~/cassandra /tmp cd /tmp/cassandra - ant clean <<parameters.target>> + ant <<parameters.target>> no_output_timeout: <<parameters.no_output_timeout>> - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -442,8 +481,6 @@ commands: steps: - run: name: Run Unit Tests (<<parameters.target>>) - # Please note that we run `clean` and therefore rebuild the project, as we can't run tests on Java 8 in case - # based on Java 11 builds. command: | export PATH=$JAVA_HOME/bin:$PATH time mv ~/cassandra /tmp diff --git a/.circleci/config.yml b/.circleci/config.yml index 1b1952d..27fda51 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -68,90 +68,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - ANT_HOME: /usr/share/ant - - LANG: en_US.UTF-8 - - KEEP_TEST_DIR: true - - DEFAULT_DIR: /home/cassandra/cassandra-dtest - - PYTHONIOENCODING: utf-8 - - PYTHONUNBUFFERED: true - - CASS_DRIVER_NO_EXTENSIONS: true - - CASS_DRIVER_NO_CYTHON: true - - CASSANDRA_SKIP_SYNC: true - - DTEST_REPO: git://github.com/apache/cassandra-dtest.git - - DTEST_BRANCH: master - - CCM_MAX_HEAP_SIZE: 1024M - - CCM_HEAP_NEWSIZE: 256M - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - build: - docker: - - image: spod/cassandra-testing-ubuntu1810-java11:20181210 - resource_class: medium - working_directory: ~/ - shell: /bin/bash -eo pipefail -l - parallelism: 1 - steps: - - 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) - command: | - git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH git://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 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 - - 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: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -167,6 +83,7 @@ jobs: - CCM_HEAP_NEWSIZE: 256M - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - CASSANDRA_USE_JDK11: true j11_dtests-with-vnodes: docker: - image: spod/cassandra-testing-ubuntu1810-java11:20181210 @@ -221,7 +138,7 @@ jobs: \ 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 ~/env/bin/activate\n\ - export PATH=$JAVA_HOME/bin:$PATH\n\nif [ -z '' ]; then\n export \nfi\n\n\ + export PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\n\ echo \"***Collected DTests (j11_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py\ \ --use-vnodes --skip-resource-intensive-tests --dtest-print-tests-only\ \ --dtest-print-tests-output=/tmp/all_dtest_tests_j11_with_vnodes_raw --cassandra-dir=../cassandra\n\ @@ -237,7 +154,7 @@ jobs: no_output_timeout: 15m command: "echo \"cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\"\n\ cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\n\nsource ~/env/bin/activate\n\ - export PATH=$JAVA_HOME/bin:$PATH\nif [ -z '' ]; then\n export \nfi\n\n\ + export PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\n\ java -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\ @@ -256,8 +173,6 @@ jobs: path: ~/cassandra-dtest/logs destination: dtest_j11_with_vnodes_logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -273,6 +188,7 @@ jobs: - CCM_HEAP_NEWSIZE: 256M - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - CASSANDRA_USE_JDK11: true j8_dtests-no-vnodes: docker: - image: spod/cassandra-testing-ubuntu1810-java11-w-dependencies:20190306 @@ -341,8 +257,6 @@ jobs: path: ~/cassandra-dtest/logs destination: dtest_j8_without_vnodes_logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -441,8 +355,6 @@ jobs: path: ~/cassandra-dtest/logs destination: dtest_j8_upgradetests_without_vnodes_logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -474,7 +386,7 @@ jobs: export PATH=$JAVA_HOME/bin:$PATH time mv ~/cassandra /tmp cd /tmp/cassandra - ant clean stress-test + ant stress-test no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -485,8 +397,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -570,8 +480,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -587,6 +495,87 @@ jobs: - CCM_HEAP_NEWSIZE: 256M - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + j11_build: + docker: + - image: spod/cassandra-testing-ubuntu1810-java11:20181210 + resource_class: medium + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 1 + steps: + - 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) + command: | + git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH git://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 + - 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 + - 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: git://github.com/apache/cassandra-dtest.git + - DTEST_BRANCH: master + - CCM_MAX_HEAP_SIZE: 1024M + - CCM_HEAP_NEWSIZE: 256M + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - CASSANDRA_USE_JDK11: true j8_dtests-with-vnodes: docker: - image: spod/cassandra-testing-ubuntu1810-java11-w-dependencies:20190306 @@ -654,8 +643,6 @@ jobs: path: ~/cassandra-dtest/logs destination: dtest_j8_with_vnodes_logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -687,7 +674,7 @@ jobs: export PATH=$JAVA_HOME/bin:$PATH time mv ~/cassandra /tmp cd /tmp/cassandra - ant clean test-jvm-dtest-forking + ant test-jvm-dtest-forking no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -698,8 +685,86 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - ANT_HOME: /usr/share/ant + - LANG: en_US.UTF-8 + - KEEP_TEST_DIR: true + - DEFAULT_DIR: /home/cassandra/cassandra-dtest + - PYTHONIOENCODING: utf-8 + - PYTHONUNBUFFERED: true + - CASS_DRIVER_NO_EXTENSIONS: true + - CASS_DRIVER_NO_CYTHON: true + - CASSANDRA_SKIP_SYNC: true + - DTEST_REPO: git://github.com/apache/cassandra-dtest.git + - DTEST_BRANCH: master + - CCM_MAX_HEAP_SIZE: 1024M + - CCM_HEAP_NEWSIZE: 256M + - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + j8_build: + docker: + - image: spod/cassandra-testing-ubuntu1810-java11-w-dependencies:20190306 + resource_class: medium + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 1 + steps: + - 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) + command: | + git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH git://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 + - 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 - KEEP_TEST_DIR: true @@ -731,7 +796,7 @@ jobs: export PATH=$JAVA_HOME/bin:$PATH time mv ~/cassandra /tmp cd /tmp/cassandra - ant clean long-test + ant long-test no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -742,8 +807,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -775,7 +838,7 @@ jobs: export PATH=$JAVA_HOME/bin:$PATH time mv ~/cassandra /tmp cd /tmp/cassandra - ant clean fqltool-test + ant fqltool-test no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -786,8 +849,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -857,7 +918,7 @@ jobs: \ 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 ~/env/bin/activate\n\ - export PATH=$JAVA_HOME/bin:$PATH\n\nif [ -z '' ]; then\n export \nfi\n\n\ + export PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\n\ echo \"***Collected DTests (j11_without_vnodes)***\"\nset -eo pipefail &&\ \ ./run_dtests.py --skip-resource-intensive-tests --dtest-print-tests-only\ \ --dtest-print-tests-output=/tmp/all_dtest_tests_j11_without_vnodes_raw\ @@ -874,7 +935,7 @@ jobs: 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 ~/env/bin/activate\n\ - export PATH=$JAVA_HOME/bin:$PATH\nif [ -z '' ]; then\n export \nfi\n\n\ + export PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\n\ java -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\ @@ -893,8 +954,6 @@ jobs: path: ~/cassandra-dtest/logs destination: dtest_j11_without_vnodes_logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -910,6 +969,7 @@ jobs: - CCM_HEAP_NEWSIZE: 256M - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - CASSANDRA_USE_JDK11: true utests_compression: docker: - image: spod/cassandra-testing-ubuntu1810-java11-w-dependencies:20190306 @@ -978,8 +1038,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -997,54 +1055,54 @@ jobs: - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 workflows: version: 2 - build_and_run_tests: + java8_build_and_run_tests: jobs: - - build + - j8_build - j8_unit_tests: requires: - - build + - j8_build - j8_jvm_dtests: requires: - - build + - j8_build - start_j11_unit_tests: type: approval requires: - - build + - j8_build - j11_unit_tests: requires: - start_j11_unit_tests - start_utests_long: type: approval requires: - - build + - j8_build - utests_long: requires: - start_utests_long - start_utests_compression: type: approval requires: - - build + - j8_build - utests_compression: requires: - start_utests_compression - start_utests_stress: type: approval requires: - - build + - j8_build - utests_stress: requires: - start_utests_stress - start_utests_fqltool: type: approval requires: - - build + - j8_build - utests_fqltool: requires: - start_utests_fqltool - start_j8_dtests: type: approval requires: - - build + - j8_build - j8_dtests-with-vnodes: requires: - start_j8_dtests @@ -1054,7 +1112,7 @@ workflows: - start_j11_dtests: type: approval requires: - - build + - j8_build - j11_dtests-with-vnodes: requires: - start_j11_dtests @@ -1064,567 +1122,27 @@ workflows: - start_upgrade_tests: type: approval requires: - - build + - j8_build - j8_upgradetests-no-vnodes: requires: - start_upgrade_tests - -# Original config.yml file: -# version: 2.1 -# -# default_env_vars: &default_env_vars -# JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 -# JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 -# ANT_HOME: /usr/share/ant -# LANG: en_US.UTF-8 -# KEEP_TEST_DIR: true -# DEFAULT_DIR: /home/cassandra/cassandra-dtest -# PYTHONIOENCODING: utf-8 -# PYTHONUNBUFFERED: true -# CASS_DRIVER_NO_EXTENSIONS: true -# CASS_DRIVER_NO_CYTHON: true -# #Skip all syncing to disk to avoid performance issues in flaky CI environments -# CASSANDRA_SKIP_SYNC: true -# DTEST_REPO: git://github.com/apache/cassandra-dtest.git -# DTEST_BRANCH: master -# CCM_MAX_HEAP_SIZE: 1024M -# CCM_HEAP_NEWSIZE: 256M -# -# j8_par_executor: &j8_par_executor -# executor: -# name: java8-executor -# #exec_resource_class: xlarge -# parallelism: 4 -# -# j8_seq_executor: &j8_seq_executor -# executor: -# name: java8-executor -# #exec_resource_class: xlarge -# parallelism: 1 # sequential, single container tests: no parallelism benefits -# -# j11_par_executor: &j11_par_executor -# executor: -# name: java11-executor -# #exec_resource_class: xlarge -# parallelism: 4 -# -# with_dtests_jobs: &with_dtest_jobs -# jobs: -# - build -# # Java 8 unit tests will be run automatically -# - j8_unit_tests: -# requires: -# - build -# - j8_jvm_dtests: -# requires: -# - build -# # Java 11 unit tests (on request, currently not working) -# - start_j11_unit_tests: -# type: approval -# requires: -# - build -# - j11_unit_tests: -# requires: -# - start_j11_unit_tests -# # specialized unit tests (all run on request using Java 8) -# - start_utests_long: -# type: approval -# requires: -# - build -# - utests_long: -# requires: -# - start_utests_long -# - start_utests_compression: -# type: approval -# requires: -# - build -# - utests_compression: -# requires: -# - start_utests_compression -# - start_utests_stress: -# type: approval -# requires: -# - build -# - utests_stress: -# requires: -# - start_utests_stress -# - start_utests_fqltool: -# type: approval -# requires: -# - build -# - utests_fqltool: -# requires: -# - start_utests_fqltool -# # Java 8 dtests (on request) -# - start_j8_dtests: -# type: approval -# requires: -# - build -# - j8_dtests-with-vnodes: -# requires: -# - start_j8_dtests -# - j8_dtests-no-vnodes: -# requires: -# - start_j8_dtests -# # Java 11 dtests (on request) -# - start_j11_dtests: -# type: approval -# requires: -# - build -# - j11_dtests-with-vnodes: -# requires: -# - start_j11_dtests -# - j11_dtests-no-vnodes: -# requires: -# - start_j11_dtests -# # Java 8 upgrade tests -# - start_upgrade_tests: -# type: approval -# requires: -# - build -# - j8_upgradetests-no-vnodes: -# requires: -# - start_upgrade_tests -# -# with_dtest_jobs_only: &with_dtest_jobs_only -# jobs: -# - build -# - j8_dtests-with-vnodes: -# requires: -# - build -# - j8_dtests-no-vnodes: -# requires: -# - build -# -# workflows: -# version: 2 -# build_and_run_tests: *with_dtest_jobs -# #build_and_run_tests: *with_dtest_jobs_only -# -# executors: -# java8-executor: -# parameters: -# exec_resource_class: -# type: string -# default: medium -# docker: -# - image: spod/cassandra-testing-ubuntu1810-java11-w-dependencies:20190306 -# resource_class: << parameters.exec_resource_class >> -# working_directory: ~/ -# shell: /bin/bash -eo pipefail -l -# environment: -# <<: *default_env_vars -# JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 -# JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 -# -# java11-executor: -# parameters: -# exec_resource_class: -# type: string -# default: medium -# docker: -# - image: spod/cassandra-testing-ubuntu1810-java11:20181210 -# resource_class: << parameters.exec_resource_class >> -# working_directory: ~/ -# shell: /bin/bash -eo pipefail -l -# environment: -# <<: *default_env_vars -# JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 -# JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 -# -# jobs: -# build: -# executor: java11-executor -# parallelism: 1 # This job doesn't benefit from parallelism -# steps: -# - log_environment -# - clone_cassandra -# - build_cassandra -# - run_eclipse_warnings -# - persist_to_workspace: -# root: /home/cassandra -# paths: -# - cassandra -# - .m2 -# -# j8_unit_tests: -# <<: *j8_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - create_junit_containers -# - log_environment -# - run_parallel_junit_tests -# -# j8_jvm_dtests: -# <<: *j8_seq_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - run_junit_tests: -# target: test-jvm-dtest-forking -# -# j11_unit_tests: -# <<: *j11_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - create_junit_containers -# - log_environment -# - run_parallel_junit_tests -# -# utests_long: -# <<: *j8_seq_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - run_junit_tests: -# target: long-test -# -# utests_compression: -# <<: *j8_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - create_junit_containers -# - log_environment -# - run_parallel_junit_tests: -# target: testclasslist-compression -# -# utests_stress: -# <<: *j8_seq_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - run_junit_tests: -# target: stress-test -# -# utests_fqltool: -# <<: *j8_seq_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - run_junit_tests: -# target: fqltool-test -# -# j8_dtests-with-vnodes: -# <<: *j8_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - clone_dtest -# - create_venv -# - create_dtest_containers: -# file_tag: j8_with_vnodes -# run_dtests_extra_args: '--use-vnodes --skip-resource-intensive-tests' -# - run_dtests: -# file_tag: j8_with_vnodes -# pytest_extra_args: '--use-vnodes --num-tokens=32 --skip-resource-intensive-tests' -# -# j11_dtests-with-vnodes: -# <<: *j11_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - log_environment -# - clone_dtest -# - create_venv -# - create_dtest_containers: -# file_tag: j11_with_vnodes -# run_dtests_extra_args: '--use-vnodes --skip-resource-intensive-tests' -# - run_dtests: -# file_tag: j11_with_vnodes -# pytest_extra_args: '--use-vnodes --num-tokens=32 --skip-resource-intensive-tests' -# -# j8_dtests-no-vnodes: -# <<: *j8_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - clone_dtest -# - create_venv -# - create_dtest_containers: -# file_tag: j8_without_vnodes -# run_dtests_extra_args: '--skip-resource-intensive-tests' -# - run_dtests: -# file_tag: j8_without_vnodes -# pytest_extra_args: '--skip-resource-intensive-tests' -# -# j11_dtests-no-vnodes: -# <<: *j11_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - log_environment -# - clone_dtest -# - create_venv -# - create_dtest_containers: -# file_tag: j11_without_vnodes -# run_dtests_extra_args: '--skip-resource-intensive-tests' -# - run_dtests: -# file_tag: j11_without_vnodes -# pytest_extra_args: '--skip-resource-intensive-tests' -# -# j8_upgradetests-no-vnodes: -# <<: *j8_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - clone_dtest -# - create_venv -# - create_dtest_containers: -# file_tag: j8_upgradetests_without_vnodes -# run_dtests_extra_args: '--execute-upgrade-tests' -# extra_env_args: 'RUN_STATIC_UPGRADE_MATRIX=true' -# tests_filter_pattern: '^upgrade_tests' -# - run_dtests: -# file_tag: j8_upgradetests_without_vnodes -# extra_env_args: 'RUN_STATIC_UPGRADE_MATRIX=true' -# pytest_extra_args: '--execute-upgrade-tests' -# -# commands: -# log_environment: -# steps: -# - 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 -# -# clone_cassandra: -# steps: -# - run: -# name: Clone Cassandra Repository (via git) -# command: | -# git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH git://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git ~/cassandra -# -# clone_dtest: -# steps: -# - run: -# name: Clone Cassandra dtest Repository (via git) -# command: | -# git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest -# -# build_cassandra: -# steps: -# - 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 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 -# -# run_eclipse_warnings: -# steps: -# - run: -# name: Run eclipse-warnings -# command: | -# export PATH=$JAVA_HOME/bin:$PATH -# cd ~/cassandra -# ant eclipse-warnings -# -# create_junit_containers: -# steps: -# - 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 | cut -c 37-1000000 | 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_junit_tests: -# parameters: -# target: -# type: string -# no_output_timeout: -# type: string -# default: 15m -# steps: -# - run: -# name: Run Unit Tests (<<parameters.target>>) -# # Please note that we run `clean` and therefore rebuild the project, as we can't run tests on Java 8 in case -# # based on Java 11 builds. -# command: | -# export PATH=$JAVA_HOME/bin:$PATH -# time mv ~/cassandra /tmp -# cd /tmp/cassandra -# ant clean <<parameters.target>> -# no_output_timeout: <<parameters.no_output_timeout>> -# - 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 -# -# run_parallel_junit_tests: -# parameters: -# target: -# type: string -# default: testclasslist -# no_output_timeout: -# type: string -# default: 15m -# steps: -# - run: -# name: Run Unit Tests (<<parameters.target>>) -# # Please note that we run `clean` and therefore rebuild the project, as we can't run tests on Java 8 in case -# # based on Java 11 builds. -# command: | -# export PATH=$JAVA_HOME/bin:$PATH -# time mv ~/cassandra /tmp -# cd /tmp/cassandra -# ant <<parameters.target>> -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -# no_output_timeout: <<parameters.no_output_timeout>> -# - 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 -# -# create_venv: -# steps: -# - 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 ~/env/bin/activate -# export PATH=$JAVA_HOME/bin:$PATH -# pip3 install --upgrade -r ~/cassandra-dtest/requirements.txt -# pip3 freeze -# -# create_dtest_containers: -# parameters: -# file_tag: -# type: string -# run_dtests_extra_args: -# type: string -# default: '' -# extra_env_args: -# type: string -# default: '' -# tests_filter_pattern: -# type: string -# default: '' -# steps: -# - run: -# name: Determine Tests to Run (<<parameters.file_tag>>) -# no_output_timeout: 5m -# 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. -# -# cd cassandra-dtest -# source ~/env/bin/activate -# export PATH=$JAVA_HOME/bin:$PATH -# -# if [ -n '<<parameters.extra_env_args>>' ]; then -# export <<parameters.extra_env_args>> -# fi -# -# echo \"***Collected DTests (<<parameters.file_tag>>)***\" -# set -eo pipefail && ./run_dtests.py <<parameters.run_dtests_extra_args>> --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_<<parameters.file_tag>>_raw --cassandra-dir=../cassandra -# if [ -z '<<parameters.tests_filter_pattern>>' ]; then -# mv /tmp/all_dtest_tests_<<parameters.file_tag>>_raw /tmp/all_dtest_tests_<<parameters.file_tag>> -# else -# grep -e '<<parameters.tests_filter_pattern>>' /tmp/all_dtest_tests_<<parameters.file_tag>>_raw > /tmp/all_dtest_tests_<<parameters.file_tag>> || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; } -# fi -# set -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_<<parameters.file_tag>> > /tmp/split_dtest_tests_<<parameters.file_tag>>.txt -# cat /tmp/split_dtest_tests_<<parameters.file_tag>>.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_<<parameters.file_tag>>_final.txt -# cat /tmp/split_dtest_tests_<<parameters.file_tag>>_final.txt -# -# run_dtests: -# parameters: -# file_tag: -# type: string -# pytest_extra_args: -# type: string -# default: '' -# extra_env_args: -# type: string -# default: '' -# steps: -# - run: -# name: Run dtests (<<parameters.file_tag>>) -# no_output_timeout: 15m -# command: | -# echo \"cat /tmp/split_dtest_tests_<<parameters.file_tag>>_final.txt\" -# cat /tmp/split_dtest_tests_<<parameters.file_tag>>_final.txt -# -# source ~/env/bin/activate -# export PATH=$JAVA_HOME/bin:$PATH -# if [ -n '<<parameters.extra_env_args>>' ]; then -# export <<parameters.extra_env_args>> -# 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_<<parameters.file_tag>>_final.txt` -# set -o pipefail && cd ~/cassandra-dtest && pytest <<parameters.pytest_extra_args>> --log-level=\"INFO\" --junit-xml=/tmp/results/dtests/pytest_result_<<parameters.file_tag>>.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt -# - store_test_results: -# path: /tmp/results -# - store_artifacts: -# path: /tmp/dtest -# destination: dtest_<<parameters.file_tag>> -# - store_artifacts: -# path: ~/cassandra-dtest/logs -# destination: dtest_<<parameters.file_tag>>_logs \ No newline at end of file + java11_build_and_run_tests: + jobs: + - j11_build + - start_j11_unit_tests: + type: approval + requires: + - j11_build + - j11_unit_tests: + requires: + - start_j11_unit_tests + - start_j11_dtests: + type: approval + requires: + - j11_build + - j11_dtests-with-vnodes: + requires: + - start_j11_dtests + - j11_dtests-no-vnodes: + requires: + - start_j11_dtests diff --git a/.circleci/config.yml.HIGHRES b/.circleci/config.yml.HIGHRES index 84efce7..8ac50c9 100644 --- a/.circleci/config.yml.HIGHRES +++ b/.circleci/config.yml.HIGHRES @@ -68,90 +68,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - ANT_HOME: /usr/share/ant - - LANG: en_US.UTF-8 - - KEEP_TEST_DIR: true - - DEFAULT_DIR: /home/cassandra/cassandra-dtest - - PYTHONIOENCODING: utf-8 - - PYTHONUNBUFFERED: true - - CASS_DRIVER_NO_EXTENSIONS: true - - CASS_DRIVER_NO_CYTHON: true - - CASSANDRA_SKIP_SYNC: true - - DTEST_REPO: git://github.com/apache/cassandra-dtest.git - - DTEST_BRANCH: master - - CCM_MAX_HEAP_SIZE: 2048M - - CCM_HEAP_NEWSIZE: 512M - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - build: - docker: - - image: spod/cassandra-testing-ubuntu1810-java11:20181210 - resource_class: medium - working_directory: ~/ - shell: /bin/bash -eo pipefail -l - parallelism: 1 - steps: - - 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) - command: | - git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH git://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 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 - - 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: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -167,6 +83,7 @@ jobs: - CCM_HEAP_NEWSIZE: 512M - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - CASSANDRA_USE_JDK11: true j11_dtests-with-vnodes: docker: - image: spod/cassandra-testing-ubuntu1810-java11:20181210 @@ -221,7 +138,7 @@ jobs: \ 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 ~/env/bin/activate\n\ - export PATH=$JAVA_HOME/bin:$PATH\n\nif [ -z '' ]; then\n export \nfi\n\n\ + export PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\n\ echo \"***Collected DTests (j11_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py\ \ --use-vnodes --skip-resource-intensive-tests --dtest-print-tests-only\ \ --dtest-print-tests-output=/tmp/all_dtest_tests_j11_with_vnodes_raw --cassandra-dir=../cassandra\n\ @@ -237,7 +154,7 @@ jobs: no_output_timeout: 15m command: "echo \"cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\"\n\ cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\n\nsource ~/env/bin/activate\n\ - export PATH=$JAVA_HOME/bin:$PATH\nif [ -z '' ]; then\n export \nfi\n\n\ + export PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\n\ java -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\ @@ -256,8 +173,6 @@ jobs: path: ~/cassandra-dtest/logs destination: dtest_j11_with_vnodes_logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -273,6 +188,7 @@ jobs: - CCM_HEAP_NEWSIZE: 512M - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - CASSANDRA_USE_JDK11: true j8_dtests-no-vnodes: docker: - image: spod/cassandra-testing-ubuntu1810-java11-w-dependencies:20190306 @@ -341,8 +257,6 @@ jobs: path: ~/cassandra-dtest/logs destination: dtest_j8_without_vnodes_logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -441,8 +355,6 @@ jobs: path: ~/cassandra-dtest/logs destination: dtest_j8_upgradetests_without_vnodes_logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -474,7 +386,7 @@ jobs: export PATH=$JAVA_HOME/bin:$PATH time mv ~/cassandra /tmp cd /tmp/cassandra - ant clean stress-test + ant stress-test no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -485,8 +397,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -570,8 +480,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -587,6 +495,87 @@ jobs: - CCM_HEAP_NEWSIZE: 512M - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + j11_build: + docker: + - image: spod/cassandra-testing-ubuntu1810-java11:20181210 + resource_class: medium + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 1 + steps: + - 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) + command: | + git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH git://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 + - 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 + - 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: git://github.com/apache/cassandra-dtest.git + - DTEST_BRANCH: master + - CCM_MAX_HEAP_SIZE: 2048M + - CCM_HEAP_NEWSIZE: 512M + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - CASSANDRA_USE_JDK11: true j8_dtests-with-vnodes: docker: - image: spod/cassandra-testing-ubuntu1810-java11-w-dependencies:20190306 @@ -654,8 +643,6 @@ jobs: path: ~/cassandra-dtest/logs destination: dtest_j8_with_vnodes_logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -687,7 +674,7 @@ jobs: export PATH=$JAVA_HOME/bin:$PATH time mv ~/cassandra /tmp cd /tmp/cassandra - ant clean test-jvm-dtest-forking + ant test-jvm-dtest-forking no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -698,8 +685,86 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - ANT_HOME: /usr/share/ant + - LANG: en_US.UTF-8 + - KEEP_TEST_DIR: true + - DEFAULT_DIR: /home/cassandra/cassandra-dtest + - PYTHONIOENCODING: utf-8 + - PYTHONUNBUFFERED: true + - CASS_DRIVER_NO_EXTENSIONS: true + - CASS_DRIVER_NO_CYTHON: true + - CASSANDRA_SKIP_SYNC: true + - DTEST_REPO: git://github.com/apache/cassandra-dtest.git + - DTEST_BRANCH: master + - CCM_MAX_HEAP_SIZE: 2048M + - CCM_HEAP_NEWSIZE: 512M + - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + j8_build: + docker: + - image: spod/cassandra-testing-ubuntu1810-java11-w-dependencies:20190306 + resource_class: medium + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 1 + steps: + - 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) + command: | + git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH git://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 + - 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 - KEEP_TEST_DIR: true @@ -731,7 +796,7 @@ jobs: export PATH=$JAVA_HOME/bin:$PATH time mv ~/cassandra /tmp cd /tmp/cassandra - ant clean long-test + ant long-test no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -742,8 +807,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -775,7 +838,7 @@ jobs: export PATH=$JAVA_HOME/bin:$PATH time mv ~/cassandra /tmp cd /tmp/cassandra - ant clean fqltool-test + ant fqltool-test no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -786,8 +849,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -857,7 +918,7 @@ jobs: \ 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 ~/env/bin/activate\n\ - export PATH=$JAVA_HOME/bin:$PATH\n\nif [ -z '' ]; then\n export \nfi\n\n\ + export PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\n\ echo \"***Collected DTests (j11_without_vnodes)***\"\nset -eo pipefail &&\ \ ./run_dtests.py --skip-resource-intensive-tests --dtest-print-tests-only\ \ --dtest-print-tests-output=/tmp/all_dtest_tests_j11_without_vnodes_raw\ @@ -874,7 +935,7 @@ jobs: 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 ~/env/bin/activate\n\ - export PATH=$JAVA_HOME/bin:$PATH\nif [ -z '' ]; then\n export \nfi\n\n\ + export PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\n\ java -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\ @@ -893,8 +954,6 @@ jobs: path: ~/cassandra-dtest/logs destination: dtest_j11_without_vnodes_logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -910,6 +969,7 @@ jobs: - CCM_HEAP_NEWSIZE: 512M - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - CASSANDRA_USE_JDK11: true utests_compression: docker: - image: spod/cassandra-testing-ubuntu1810-java11-w-dependencies:20190306 @@ -978,8 +1038,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -997,54 +1055,54 @@ jobs: - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 workflows: version: 2 - build_and_run_tests: + java8_build_and_run_tests: jobs: - - build + - j8_build - j8_unit_tests: requires: - - build + - j8_build - j8_jvm_dtests: requires: - - build + - j8_build - start_j11_unit_tests: type: approval requires: - - build + - j8_build - j11_unit_tests: requires: - start_j11_unit_tests - start_utests_long: type: approval requires: - - build + - j8_build - utests_long: requires: - start_utests_long - start_utests_compression: type: approval requires: - - build + - j8_build - utests_compression: requires: - start_utests_compression - start_utests_stress: type: approval requires: - - build + - j8_build - utests_stress: requires: - start_utests_stress - start_utests_fqltool: type: approval requires: - - build + - j8_build - utests_fqltool: requires: - start_utests_fqltool - start_j8_dtests: type: approval requires: - - build + - j8_build - j8_dtests-with-vnodes: requires: - start_j8_dtests @@ -1054,7 +1112,7 @@ workflows: - start_j11_dtests: type: approval requires: - - build + - j8_build - j11_dtests-with-vnodes: requires: - start_j11_dtests @@ -1064,567 +1122,27 @@ workflows: - start_upgrade_tests: type: approval requires: - - build + - j8_build - j8_upgradetests-no-vnodes: requires: - start_upgrade_tests - -# Original config.yml file: -# version: 2.1 -# -# default_env_vars: &default_env_vars -# JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 -# JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 -# ANT_HOME: /usr/share/ant -# LANG: en_US.UTF-8 -# KEEP_TEST_DIR: true -# DEFAULT_DIR: /home/cassandra/cassandra-dtest -# PYTHONIOENCODING: utf-8 -# PYTHONUNBUFFERED: true -# CASS_DRIVER_NO_EXTENSIONS: true -# CASS_DRIVER_NO_CYTHON: true -# #Skip all syncing to disk to avoid performance issues in flaky CI environments -# CASSANDRA_SKIP_SYNC: true -# DTEST_REPO: git://github.com/apache/cassandra-dtest.git -# DTEST_BRANCH: master -# CCM_MAX_HEAP_SIZE: 2048M -# CCM_HEAP_NEWSIZE: 512M -# -# j8_par_executor: &j8_par_executor -# executor: -# name: java8-executor -# exec_resource_class: xlarge -# parallelism: 100 -# -# j8_seq_executor: &j8_seq_executor -# executor: -# name: java8-executor -# exec_resource_class: xlarge -# parallelism: 1 # sequential, single container tests: no parallelism benefits -# -# j11_par_executor: &j11_par_executor -# executor: -# name: java11-executor -# exec_resource_class: xlarge -# parallelism: 100 -# -# with_dtests_jobs: &with_dtest_jobs -# jobs: -# - build -# # Java 8 unit tests will be run automatically -# - j8_unit_tests: -# requires: -# - build -# - j8_jvm_dtests: -# requires: -# - build -# # Java 11 unit tests (on request, currently not working) -# - start_j11_unit_tests: -# type: approval -# requires: -# - build -# - j11_unit_tests: -# requires: -# - start_j11_unit_tests -# # specialized unit tests (all run on request using Java 8) -# - start_utests_long: -# type: approval -# requires: -# - build -# - utests_long: -# requires: -# - start_utests_long -# - start_utests_compression: -# type: approval -# requires: -# - build -# - utests_compression: -# requires: -# - start_utests_compression -# - start_utests_stress: -# type: approval -# requires: -# - build -# - utests_stress: -# requires: -# - start_utests_stress -# - start_utests_fqltool: -# type: approval -# requires: -# - build -# - utests_fqltool: -# requires: -# - start_utests_fqltool -# # Java 8 dtests (on request) -# - start_j8_dtests: -# type: approval -# requires: -# - build -# - j8_dtests-with-vnodes: -# requires: -# - start_j8_dtests -# - j8_dtests-no-vnodes: -# requires: -# - start_j8_dtests -# # Java 11 dtests (on request) -# - start_j11_dtests: -# type: approval -# requires: -# - build -# - j11_dtests-with-vnodes: -# requires: -# - start_j11_dtests -# - j11_dtests-no-vnodes: -# requires: -# - start_j11_dtests -# # Java 8 upgrade tests -# - start_upgrade_tests: -# type: approval -# requires: -# - build -# - j8_upgradetests-no-vnodes: -# requires: -# - start_upgrade_tests -# -# with_dtest_jobs_only: &with_dtest_jobs_only -# jobs: -# - build -# - j8_dtests-with-vnodes: -# requires: -# - build -# - j8_dtests-no-vnodes: -# requires: -# - build -# -# workflows: -# version: 2 -# build_and_run_tests: *with_dtest_jobs -# #build_and_run_tests: *with_dtest_jobs_only -# -# executors: -# java8-executor: -# parameters: -# exec_resource_class: -# type: string -# default: medium -# docker: -# - image: spod/cassandra-testing-ubuntu1810-java11-w-dependencies:20190306 -# resource_class: << parameters.exec_resource_class >> -# working_directory: ~/ -# shell: /bin/bash -eo pipefail -l -# environment: -# <<: *default_env_vars -# JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 -# JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 -# -# java11-executor: -# parameters: -# exec_resource_class: -# type: string -# default: medium -# docker: -# - image: spod/cassandra-testing-ubuntu1810-java11:20181210 -# resource_class: << parameters.exec_resource_class >> -# working_directory: ~/ -# shell: /bin/bash -eo pipefail -l -# environment: -# <<: *default_env_vars -# JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 -# JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 -# -# jobs: -# build: -# executor: java11-executor -# parallelism: 1 # This job doesn't benefit from parallelism -# steps: -# - log_environment -# - clone_cassandra -# - build_cassandra -# - run_eclipse_warnings -# - persist_to_workspace: -# root: /home/cassandra -# paths: -# - cassandra -# - .m2 -# -# j8_unit_tests: -# <<: *j8_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - create_junit_containers -# - log_environment -# - run_parallel_junit_tests -# -# j8_jvm_dtests: -# <<: *j8_seq_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - run_junit_tests: -# target: test-jvm-dtest-forking -# -# j11_unit_tests: -# <<: *j11_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - create_junit_containers -# - log_environment -# - run_parallel_junit_tests -# -# utests_long: -# <<: *j8_seq_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - run_junit_tests: -# target: long-test -# -# utests_compression: -# <<: *j8_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - create_junit_containers -# - log_environment -# - run_parallel_junit_tests: -# target: testclasslist-compression -# -# utests_stress: -# <<: *j8_seq_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - run_junit_tests: -# target: stress-test -# -# utests_fqltool: -# <<: *j8_seq_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - run_junit_tests: -# target: fqltool-test -# -# j8_dtests-with-vnodes: -# <<: *j8_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - clone_dtest -# - create_venv -# - create_dtest_containers: -# file_tag: j8_with_vnodes -# run_dtests_extra_args: '--use-vnodes --skip-resource-intensive-tests' -# - run_dtests: -# file_tag: j8_with_vnodes -# pytest_extra_args: '--use-vnodes --num-tokens=32 --skip-resource-intensive-tests' -# -# j11_dtests-with-vnodes: -# <<: *j11_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - log_environment -# - clone_dtest -# - create_venv -# - create_dtest_containers: -# file_tag: j11_with_vnodes -# run_dtests_extra_args: '--use-vnodes --skip-resource-intensive-tests' -# - run_dtests: -# file_tag: j11_with_vnodes -# pytest_extra_args: '--use-vnodes --num-tokens=32 --skip-resource-intensive-tests' -# -# j8_dtests-no-vnodes: -# <<: *j8_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - clone_dtest -# - create_venv -# - create_dtest_containers: -# file_tag: j8_without_vnodes -# run_dtests_extra_args: '--skip-resource-intensive-tests' -# - run_dtests: -# file_tag: j8_without_vnodes -# pytest_extra_args: '--skip-resource-intensive-tests' -# -# j11_dtests-no-vnodes: -# <<: *j11_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - log_environment -# - clone_dtest -# - create_venv -# - create_dtest_containers: -# file_tag: j11_without_vnodes -# run_dtests_extra_args: '--skip-resource-intensive-tests' -# - run_dtests: -# file_tag: j11_without_vnodes -# pytest_extra_args: '--skip-resource-intensive-tests' -# -# j8_upgradetests-no-vnodes: -# <<: *j8_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - clone_dtest -# - create_venv -# - create_dtest_containers: -# file_tag: j8_upgradetests_without_vnodes -# run_dtests_extra_args: '--execute-upgrade-tests' -# extra_env_args: 'RUN_STATIC_UPGRADE_MATRIX=true' -# tests_filter_pattern: '^upgrade_tests' -# - run_dtests: -# file_tag: j8_upgradetests_without_vnodes -# extra_env_args: 'RUN_STATIC_UPGRADE_MATRIX=true' -# pytest_extra_args: '--execute-upgrade-tests' -# -# commands: -# log_environment: -# steps: -# - 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 -# -# clone_cassandra: -# steps: -# - run: -# name: Clone Cassandra Repository (via git) -# command: | -# git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH git://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git ~/cassandra -# -# clone_dtest: -# steps: -# - run: -# name: Clone Cassandra dtest Repository (via git) -# command: | -# git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest -# -# build_cassandra: -# steps: -# - 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 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 -# -# run_eclipse_warnings: -# steps: -# - run: -# name: Run eclipse-warnings -# command: | -# export PATH=$JAVA_HOME/bin:$PATH -# cd ~/cassandra -# ant eclipse-warnings -# -# create_junit_containers: -# steps: -# - 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 | cut -c 37-1000000 | 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_junit_tests: -# parameters: -# target: -# type: string -# no_output_timeout: -# type: string -# default: 15m -# steps: -# - run: -# name: Run Unit Tests (<<parameters.target>>) -# # Please note that we run `clean` and therefore rebuild the project, as we can't run tests on Java 8 in case -# # based on Java 11 builds. -# command: | -# export PATH=$JAVA_HOME/bin:$PATH -# time mv ~/cassandra /tmp -# cd /tmp/cassandra -# ant clean <<parameters.target>> -# no_output_timeout: <<parameters.no_output_timeout>> -# - 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 -# -# run_parallel_junit_tests: -# parameters: -# target: -# type: string -# default: testclasslist -# no_output_timeout: -# type: string -# default: 15m -# steps: -# - run: -# name: Run Unit Tests (<<parameters.target>>) -# # Please note that we run `clean` and therefore rebuild the project, as we can't run tests on Java 8 in case -# # based on Java 11 builds. -# command: | -# export PATH=$JAVA_HOME/bin:$PATH -# time mv ~/cassandra /tmp -# cd /tmp/cassandra -# ant <<parameters.target>> -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -# no_output_timeout: <<parameters.no_output_timeout>> -# - 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 -# -# create_venv: -# steps: -# - 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 ~/env/bin/activate -# export PATH=$JAVA_HOME/bin:$PATH -# pip3 install --upgrade -r ~/cassandra-dtest/requirements.txt -# pip3 freeze -# -# create_dtest_containers: -# parameters: -# file_tag: -# type: string -# run_dtests_extra_args: -# type: string -# default: '' -# extra_env_args: -# type: string -# default: '' -# tests_filter_pattern: -# type: string -# default: '' -# steps: -# - run: -# name: Determine Tests to Run (<<parameters.file_tag>>) -# no_output_timeout: 5m -# 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. -# -# cd cassandra-dtest -# source ~/env/bin/activate -# export PATH=$JAVA_HOME/bin:$PATH -# -# if [ -n '<<parameters.extra_env_args>>' ]; then -# export <<parameters.extra_env_args>> -# fi -# -# echo \"***Collected DTests (<<parameters.file_tag>>)***\" -# set -eo pipefail && ./run_dtests.py <<parameters.run_dtests_extra_args>> --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_<<parameters.file_tag>>_raw --cassandra-dir=../cassandra -# if [ -z '<<parameters.tests_filter_pattern>>' ]; then -# mv /tmp/all_dtest_tests_<<parameters.file_tag>>_raw /tmp/all_dtest_tests_<<parameters.file_tag>> -# else -# grep -e '<<parameters.tests_filter_pattern>>' /tmp/all_dtest_tests_<<parameters.file_tag>>_raw > /tmp/all_dtest_tests_<<parameters.file_tag>> || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; } -# fi -# set -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_<<parameters.file_tag>> > /tmp/split_dtest_tests_<<parameters.file_tag>>.txt -# cat /tmp/split_dtest_tests_<<parameters.file_tag>>.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_<<parameters.file_tag>>_final.txt -# cat /tmp/split_dtest_tests_<<parameters.file_tag>>_final.txt -# -# run_dtests: -# parameters: -# file_tag: -# type: string -# pytest_extra_args: -# type: string -# default: '' -# extra_env_args: -# type: string -# default: '' -# steps: -# - run: -# name: Run dtests (<<parameters.file_tag>>) -# no_output_timeout: 15m -# command: | -# echo \"cat /tmp/split_dtest_tests_<<parameters.file_tag>>_final.txt\" -# cat /tmp/split_dtest_tests_<<parameters.file_tag>>_final.txt -# -# source ~/env/bin/activate -# export PATH=$JAVA_HOME/bin:$PATH -# if [ -n '<<parameters.extra_env_args>>' ]; then -# export <<parameters.extra_env_args>> -# 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_<<parameters.file_tag>>_final.txt` -# set -o pipefail && cd ~/cassandra-dtest && pytest <<parameters.pytest_extra_args>> --log-level=\"INFO\" --junit-xml=/tmp/results/dtests/pytest_result_<<parameters.file_tag>>.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt -# - store_test_results: -# path: /tmp/results -# - store_artifacts: -# path: /tmp/dtest -# destination: dtest_<<parameters.file_tag>> -# - store_artifacts: -# path: ~/cassandra-dtest/logs -# destination: dtest_<<parameters.file_tag>>_logs \ No newline at end of file + java11_build_and_run_tests: + jobs: + - j11_build + - start_j11_unit_tests: + type: approval + requires: + - j11_build + - j11_unit_tests: + requires: + - start_j11_unit_tests + - start_j11_dtests: + type: approval + requires: + - j11_build + - j11_dtests-with-vnodes: + requires: + - start_j11_dtests + - j11_dtests-no-vnodes: + requires: + - start_j11_dtests diff --git a/.circleci/config.yml.LOWRES b/.circleci/config.yml.LOWRES index 1b1952d..27fda51 100644 --- a/.circleci/config.yml.LOWRES +++ b/.circleci/config.yml.LOWRES @@ -68,90 +68,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - ANT_HOME: /usr/share/ant - - LANG: en_US.UTF-8 - - KEEP_TEST_DIR: true - - DEFAULT_DIR: /home/cassandra/cassandra-dtest - - PYTHONIOENCODING: utf-8 - - PYTHONUNBUFFERED: true - - CASS_DRIVER_NO_EXTENSIONS: true - - CASS_DRIVER_NO_CYTHON: true - - CASSANDRA_SKIP_SYNC: true - - DTEST_REPO: git://github.com/apache/cassandra-dtest.git - - DTEST_BRANCH: master - - CCM_MAX_HEAP_SIZE: 1024M - - CCM_HEAP_NEWSIZE: 256M - - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - build: - docker: - - image: spod/cassandra-testing-ubuntu1810-java11:20181210 - resource_class: medium - working_directory: ~/ - shell: /bin/bash -eo pipefail -l - parallelism: 1 - steps: - - 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) - command: | - git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH git://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 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 - - 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: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -167,6 +83,7 @@ jobs: - CCM_HEAP_NEWSIZE: 256M - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - CASSANDRA_USE_JDK11: true j11_dtests-with-vnodes: docker: - image: spod/cassandra-testing-ubuntu1810-java11:20181210 @@ -221,7 +138,7 @@ jobs: \ 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 ~/env/bin/activate\n\ - export PATH=$JAVA_HOME/bin:$PATH\n\nif [ -z '' ]; then\n export \nfi\n\n\ + export PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\n\ echo \"***Collected DTests (j11_with_vnodes)***\"\nset -eo pipefail && ./run_dtests.py\ \ --use-vnodes --skip-resource-intensive-tests --dtest-print-tests-only\ \ --dtest-print-tests-output=/tmp/all_dtest_tests_j11_with_vnodes_raw --cassandra-dir=../cassandra\n\ @@ -237,7 +154,7 @@ jobs: no_output_timeout: 15m command: "echo \"cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\"\n\ cat /tmp/split_dtest_tests_j11_with_vnodes_final.txt\n\nsource ~/env/bin/activate\n\ - export PATH=$JAVA_HOME/bin:$PATH\nif [ -z '' ]; then\n export \nfi\n\n\ + export PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\n\ java -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\ @@ -256,8 +173,6 @@ jobs: path: ~/cassandra-dtest/logs destination: dtest_j11_with_vnodes_logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -273,6 +188,7 @@ jobs: - CCM_HEAP_NEWSIZE: 256M - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - CASSANDRA_USE_JDK11: true j8_dtests-no-vnodes: docker: - image: spod/cassandra-testing-ubuntu1810-java11-w-dependencies:20190306 @@ -341,8 +257,6 @@ jobs: path: ~/cassandra-dtest/logs destination: dtest_j8_without_vnodes_logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -441,8 +355,6 @@ jobs: path: ~/cassandra-dtest/logs destination: dtest_j8_upgradetests_without_vnodes_logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -474,7 +386,7 @@ jobs: export PATH=$JAVA_HOME/bin:$PATH time mv ~/cassandra /tmp cd /tmp/cassandra - ant clean stress-test + ant stress-test no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -485,8 +397,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -570,8 +480,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -587,6 +495,87 @@ jobs: - CCM_HEAP_NEWSIZE: 256M - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + j11_build: + docker: + - image: spod/cassandra-testing-ubuntu1810-java11:20181210 + resource_class: medium + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 1 + steps: + - 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) + command: | + git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH git://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 + - 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 + - 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: git://github.com/apache/cassandra-dtest.git + - DTEST_BRANCH: master + - CCM_MAX_HEAP_SIZE: 1024M + - CCM_HEAP_NEWSIZE: 256M + - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - CASSANDRA_USE_JDK11: true j8_dtests-with-vnodes: docker: - image: spod/cassandra-testing-ubuntu1810-java11-w-dependencies:20190306 @@ -654,8 +643,6 @@ jobs: path: ~/cassandra-dtest/logs destination: dtest_j8_with_vnodes_logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -687,7 +674,7 @@ jobs: export PATH=$JAVA_HOME/bin:$PATH time mv ~/cassandra /tmp cd /tmp/cassandra - ant clean test-jvm-dtest-forking + ant test-jvm-dtest-forking no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -698,8 +685,86 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - ANT_HOME: /usr/share/ant + - LANG: en_US.UTF-8 + - KEEP_TEST_DIR: true + - DEFAULT_DIR: /home/cassandra/cassandra-dtest + - PYTHONIOENCODING: utf-8 + - PYTHONUNBUFFERED: true + - CASS_DRIVER_NO_EXTENSIONS: true + - CASS_DRIVER_NO_CYTHON: true + - CASSANDRA_SKIP_SYNC: true + - DTEST_REPO: git://github.com/apache/cassandra-dtest.git + - DTEST_BRANCH: master + - CCM_MAX_HEAP_SIZE: 1024M + - CCM_HEAP_NEWSIZE: 256M + - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + j8_build: + docker: + - image: spod/cassandra-testing-ubuntu1810-java11-w-dependencies:20190306 + resource_class: medium + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 1 + steps: + - 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) + command: | + git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH git://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 + - 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 - KEEP_TEST_DIR: true @@ -731,7 +796,7 @@ jobs: export PATH=$JAVA_HOME/bin:$PATH time mv ~/cassandra /tmp cd /tmp/cassandra - ant clean long-test + ant long-test no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -742,8 +807,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -775,7 +838,7 @@ jobs: export PATH=$JAVA_HOME/bin:$PATH time mv ~/cassandra /tmp cd /tmp/cassandra - ant clean fqltool-test + ant fqltool-test no_output_timeout: 15m - store_test_results: path: /tmp/cassandra/build/test/output/ @@ -786,8 +849,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -857,7 +918,7 @@ jobs: \ 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 ~/env/bin/activate\n\ - export PATH=$JAVA_HOME/bin:$PATH\n\nif [ -z '' ]; then\n export \nfi\n\n\ + export PATH=$JAVA_HOME/bin:$PATH\n\nif [ -n '' ]; then\n export \nfi\n\n\ echo \"***Collected DTests (j11_without_vnodes)***\"\nset -eo pipefail &&\ \ ./run_dtests.py --skip-resource-intensive-tests --dtest-print-tests-only\ \ --dtest-print-tests-output=/tmp/all_dtest_tests_j11_without_vnodes_raw\ @@ -874,7 +935,7 @@ jobs: 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 ~/env/bin/activate\n\ - export PATH=$JAVA_HOME/bin:$PATH\nif [ -z '' ]; then\n export \nfi\n\n\ + export PATH=$JAVA_HOME/bin:$PATH\nif [ -n '' ]; then\n export \nfi\n\n\ java -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\ @@ -893,8 +954,6 @@ jobs: path: ~/cassandra-dtest/logs destination: dtest_j11_without_vnodes_logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -910,6 +969,7 @@ jobs: - CCM_HEAP_NEWSIZE: 256M - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - CASSANDRA_USE_JDK11: true utests_compression: docker: - image: spod/cassandra-testing-ubuntu1810-java11-w-dependencies:20190306 @@ -978,8 +1038,6 @@ jobs: path: /tmp/cassandra/build/test/logs destination: logs environment: - - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 - - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - ANT_HOME: /usr/share/ant - LANG: en_US.UTF-8 - KEEP_TEST_DIR: true @@ -997,54 +1055,54 @@ jobs: - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 workflows: version: 2 - build_and_run_tests: + java8_build_and_run_tests: jobs: - - build + - j8_build - j8_unit_tests: requires: - - build + - j8_build - j8_jvm_dtests: requires: - - build + - j8_build - start_j11_unit_tests: type: approval requires: - - build + - j8_build - j11_unit_tests: requires: - start_j11_unit_tests - start_utests_long: type: approval requires: - - build + - j8_build - utests_long: requires: - start_utests_long - start_utests_compression: type: approval requires: - - build + - j8_build - utests_compression: requires: - start_utests_compression - start_utests_stress: type: approval requires: - - build + - j8_build - utests_stress: requires: - start_utests_stress - start_utests_fqltool: type: approval requires: - - build + - j8_build - utests_fqltool: requires: - start_utests_fqltool - start_j8_dtests: type: approval requires: - - build + - j8_build - j8_dtests-with-vnodes: requires: - start_j8_dtests @@ -1054,7 +1112,7 @@ workflows: - start_j11_dtests: type: approval requires: - - build + - j8_build - j11_dtests-with-vnodes: requires: - start_j11_dtests @@ -1064,567 +1122,27 @@ workflows: - start_upgrade_tests: type: approval requires: - - build + - j8_build - j8_upgradetests-no-vnodes: requires: - start_upgrade_tests - -# Original config.yml file: -# version: 2.1 -# -# default_env_vars: &default_env_vars -# JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 -# JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 -# ANT_HOME: /usr/share/ant -# LANG: en_US.UTF-8 -# KEEP_TEST_DIR: true -# DEFAULT_DIR: /home/cassandra/cassandra-dtest -# PYTHONIOENCODING: utf-8 -# PYTHONUNBUFFERED: true -# CASS_DRIVER_NO_EXTENSIONS: true -# CASS_DRIVER_NO_CYTHON: true -# #Skip all syncing to disk to avoid performance issues in flaky CI environments -# CASSANDRA_SKIP_SYNC: true -# DTEST_REPO: git://github.com/apache/cassandra-dtest.git -# DTEST_BRANCH: master -# CCM_MAX_HEAP_SIZE: 1024M -# CCM_HEAP_NEWSIZE: 256M -# -# j8_par_executor: &j8_par_executor -# executor: -# name: java8-executor -# #exec_resource_class: xlarge -# parallelism: 4 -# -# j8_seq_executor: &j8_seq_executor -# executor: -# name: java8-executor -# #exec_resource_class: xlarge -# parallelism: 1 # sequential, single container tests: no parallelism benefits -# -# j11_par_executor: &j11_par_executor -# executor: -# name: java11-executor -# #exec_resource_class: xlarge -# parallelism: 4 -# -# with_dtests_jobs: &with_dtest_jobs -# jobs: -# - build -# # Java 8 unit tests will be run automatically -# - j8_unit_tests: -# requires: -# - build -# - j8_jvm_dtests: -# requires: -# - build -# # Java 11 unit tests (on request, currently not working) -# - start_j11_unit_tests: -# type: approval -# requires: -# - build -# - j11_unit_tests: -# requires: -# - start_j11_unit_tests -# # specialized unit tests (all run on request using Java 8) -# - start_utests_long: -# type: approval -# requires: -# - build -# - utests_long: -# requires: -# - start_utests_long -# - start_utests_compression: -# type: approval -# requires: -# - build -# - utests_compression: -# requires: -# - start_utests_compression -# - start_utests_stress: -# type: approval -# requires: -# - build -# - utests_stress: -# requires: -# - start_utests_stress -# - start_utests_fqltool: -# type: approval -# requires: -# - build -# - utests_fqltool: -# requires: -# - start_utests_fqltool -# # Java 8 dtests (on request) -# - start_j8_dtests: -# type: approval -# requires: -# - build -# - j8_dtests-with-vnodes: -# requires: -# - start_j8_dtests -# - j8_dtests-no-vnodes: -# requires: -# - start_j8_dtests -# # Java 11 dtests (on request) -# - start_j11_dtests: -# type: approval -# requires: -# - build -# - j11_dtests-with-vnodes: -# requires: -# - start_j11_dtests -# - j11_dtests-no-vnodes: -# requires: -# - start_j11_dtests -# # Java 8 upgrade tests -# - start_upgrade_tests: -# type: approval -# requires: -# - build -# - j8_upgradetests-no-vnodes: -# requires: -# - start_upgrade_tests -# -# with_dtest_jobs_only: &with_dtest_jobs_only -# jobs: -# - build -# - j8_dtests-with-vnodes: -# requires: -# - build -# - j8_dtests-no-vnodes: -# requires: -# - build -# -# workflows: -# version: 2 -# build_and_run_tests: *with_dtest_jobs -# #build_and_run_tests: *with_dtest_jobs_only -# -# executors: -# java8-executor: -# parameters: -# exec_resource_class: -# type: string -# default: medium -# docker: -# - image: spod/cassandra-testing-ubuntu1810-java11-w-dependencies:20190306 -# resource_class: << parameters.exec_resource_class >> -# working_directory: ~/ -# shell: /bin/bash -eo pipefail -l -# environment: -# <<: *default_env_vars -# JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 -# JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 -# -# java11-executor: -# parameters: -# exec_resource_class: -# type: string -# default: medium -# docker: -# - image: spod/cassandra-testing-ubuntu1810-java11:20181210 -# resource_class: << parameters.exec_resource_class >> -# working_directory: ~/ -# shell: /bin/bash -eo pipefail -l -# environment: -# <<: *default_env_vars -# JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 -# JDK_HOME: /usr/lib/jvm/java-11-openjdk-amd64 -# -# jobs: -# build: -# executor: java11-executor -# parallelism: 1 # This job doesn't benefit from parallelism -# steps: -# - log_environment -# - clone_cassandra -# - build_cassandra -# - run_eclipse_warnings -# - persist_to_workspace: -# root: /home/cassandra -# paths: -# - cassandra -# - .m2 -# -# j8_unit_tests: -# <<: *j8_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - create_junit_containers -# - log_environment -# - run_parallel_junit_tests -# -# j8_jvm_dtests: -# <<: *j8_seq_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - run_junit_tests: -# target: test-jvm-dtest-forking -# -# j11_unit_tests: -# <<: *j11_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - create_junit_containers -# - log_environment -# - run_parallel_junit_tests -# -# utests_long: -# <<: *j8_seq_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - run_junit_tests: -# target: long-test -# -# utests_compression: -# <<: *j8_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - create_junit_containers -# - log_environment -# - run_parallel_junit_tests: -# target: testclasslist-compression -# -# utests_stress: -# <<: *j8_seq_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - run_junit_tests: -# target: stress-test -# -# utests_fqltool: -# <<: *j8_seq_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - run_junit_tests: -# target: fqltool-test -# -# j8_dtests-with-vnodes: -# <<: *j8_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - clone_dtest -# - create_venv -# - create_dtest_containers: -# file_tag: j8_with_vnodes -# run_dtests_extra_args: '--use-vnodes --skip-resource-intensive-tests' -# - run_dtests: -# file_tag: j8_with_vnodes -# pytest_extra_args: '--use-vnodes --num-tokens=32 --skip-resource-intensive-tests' -# -# j11_dtests-with-vnodes: -# <<: *j11_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - log_environment -# - clone_dtest -# - create_venv -# - create_dtest_containers: -# file_tag: j11_with_vnodes -# run_dtests_extra_args: '--use-vnodes --skip-resource-intensive-tests' -# - run_dtests: -# file_tag: j11_with_vnodes -# pytest_extra_args: '--use-vnodes --num-tokens=32 --skip-resource-intensive-tests' -# -# j8_dtests-no-vnodes: -# <<: *j8_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - clone_dtest -# - create_venv -# - create_dtest_containers: -# file_tag: j8_without_vnodes -# run_dtests_extra_args: '--skip-resource-intensive-tests' -# - run_dtests: -# file_tag: j8_without_vnodes -# pytest_extra_args: '--skip-resource-intensive-tests' -# -# j11_dtests-no-vnodes: -# <<: *j11_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - log_environment -# - clone_dtest -# - create_venv -# - create_dtest_containers: -# file_tag: j11_without_vnodes -# run_dtests_extra_args: '--skip-resource-intensive-tests' -# - run_dtests: -# file_tag: j11_without_vnodes -# pytest_extra_args: '--skip-resource-intensive-tests' -# -# j8_upgradetests-no-vnodes: -# <<: *j8_par_executor -# steps: -# - attach_workspace: -# at: /home/cassandra -# - clone_dtest -# - create_venv -# - create_dtest_containers: -# file_tag: j8_upgradetests_without_vnodes -# run_dtests_extra_args: '--execute-upgrade-tests' -# extra_env_args: 'RUN_STATIC_UPGRADE_MATRIX=true' -# tests_filter_pattern: '^upgrade_tests' -# - run_dtests: -# file_tag: j8_upgradetests_without_vnodes -# extra_env_args: 'RUN_STATIC_UPGRADE_MATRIX=true' -# pytest_extra_args: '--execute-upgrade-tests' -# -# commands: -# log_environment: -# steps: -# - 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 -# -# clone_cassandra: -# steps: -# - run: -# name: Clone Cassandra Repository (via git) -# command: | -# git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH git://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git ~/cassandra -# -# clone_dtest: -# steps: -# - run: -# name: Clone Cassandra dtest Repository (via git) -# command: | -# git clone --single-branch --branch $DTEST_BRANCH --depth 1 $DTEST_REPO ~/cassandra-dtest -# -# build_cassandra: -# steps: -# - 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 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 -# -# run_eclipse_warnings: -# steps: -# - run: -# name: Run eclipse-warnings -# command: | -# export PATH=$JAVA_HOME/bin:$PATH -# cd ~/cassandra -# ant eclipse-warnings -# -# create_junit_containers: -# steps: -# - 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 | cut -c 37-1000000 | 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_junit_tests: -# parameters: -# target: -# type: string -# no_output_timeout: -# type: string -# default: 15m -# steps: -# - run: -# name: Run Unit Tests (<<parameters.target>>) -# # Please note that we run `clean` and therefore rebuild the project, as we can't run tests on Java 8 in case -# # based on Java 11 builds. -# command: | -# export PATH=$JAVA_HOME/bin:$PATH -# time mv ~/cassandra /tmp -# cd /tmp/cassandra -# ant clean <<parameters.target>> -# no_output_timeout: <<parameters.no_output_timeout>> -# - 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 -# -# run_parallel_junit_tests: -# parameters: -# target: -# type: string -# default: testclasslist -# no_output_timeout: -# type: string -# default: 15m -# steps: -# - run: -# name: Run Unit Tests (<<parameters.target>>) -# # Please note that we run `clean` and therefore rebuild the project, as we can't run tests on Java 8 in case -# # based on Java 11 builds. -# command: | -# export PATH=$JAVA_HOME/bin:$PATH -# time mv ~/cassandra /tmp -# cd /tmp/cassandra -# ant <<parameters.target>> -Dtest.classlistfile=/tmp/java_tests_${CIRCLE_NODE_INDEX}_final.txt -Dtest.classlistprefix=unit -# no_output_timeout: <<parameters.no_output_timeout>> -# - 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 -# -# create_venv: -# steps: -# - 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 ~/env/bin/activate -# export PATH=$JAVA_HOME/bin:$PATH -# pip3 install --upgrade -r ~/cassandra-dtest/requirements.txt -# pip3 freeze -# -# create_dtest_containers: -# parameters: -# file_tag: -# type: string -# run_dtests_extra_args: -# type: string -# default: '' -# extra_env_args: -# type: string -# default: '' -# tests_filter_pattern: -# type: string -# default: '' -# steps: -# - run: -# name: Determine Tests to Run (<<parameters.file_tag>>) -# no_output_timeout: 5m -# 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. -# -# cd cassandra-dtest -# source ~/env/bin/activate -# export PATH=$JAVA_HOME/bin:$PATH -# -# if [ -n '<<parameters.extra_env_args>>' ]; then -# export <<parameters.extra_env_args>> -# fi -# -# echo \"***Collected DTests (<<parameters.file_tag>>)***\" -# set -eo pipefail && ./run_dtests.py <<parameters.run_dtests_extra_args>> --dtest-print-tests-only --dtest-print-tests-output=/tmp/all_dtest_tests_<<parameters.file_tag>>_raw --cassandra-dir=../cassandra -# if [ -z '<<parameters.tests_filter_pattern>>' ]; then -# mv /tmp/all_dtest_tests_<<parameters.file_tag>>_raw /tmp/all_dtest_tests_<<parameters.file_tag>> -# else -# grep -e '<<parameters.tests_filter_pattern>>' /tmp/all_dtest_tests_<<parameters.file_tag>>_raw > /tmp/all_dtest_tests_<<parameters.file_tag>> || { echo \"Filter did not match any tests! Exiting build.\"; exit 0; } -# fi -# set -eo pipefail && circleci tests split --split-by=timings --timings-type=classname /tmp/all_dtest_tests_<<parameters.file_tag>> > /tmp/split_dtest_tests_<<parameters.file_tag>>.txt -# cat /tmp/split_dtest_tests_<<parameters.file_tag>>.txt | tr '\\n' ' ' > /tmp/split_dtest_tests_<<parameters.file_tag>>_final.txt -# cat /tmp/split_dtest_tests_<<parameters.file_tag>>_final.txt -# -# run_dtests: -# parameters: -# file_tag: -# type: string -# pytest_extra_args: -# type: string -# default: '' -# extra_env_args: -# type: string -# default: '' -# steps: -# - run: -# name: Run dtests (<<parameters.file_tag>>) -# no_output_timeout: 15m -# command: | -# echo \"cat /tmp/split_dtest_tests_<<parameters.file_tag>>_final.txt\" -# cat /tmp/split_dtest_tests_<<parameters.file_tag>>_final.txt -# -# source ~/env/bin/activate -# export PATH=$JAVA_HOME/bin:$PATH -# if [ -n '<<parameters.extra_env_args>>' ]; then -# export <<parameters.extra_env_args>> -# 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_<<parameters.file_tag>>_final.txt` -# set -o pipefail && cd ~/cassandra-dtest && pytest <<parameters.pytest_extra_args>> --log-level=\"INFO\" --junit-xml=/tmp/results/dtests/pytest_result_<<parameters.file_tag>>.xml -s --cassandra-dir=/home/cassandra/cassandra --keep-test-dir $SPLIT_TESTS 2>&1 | tee /tmp/dtest/stdout.txt -# - store_test_results: -# path: /tmp/results -# - store_artifacts: -# path: /tmp/dtest -# destination: dtest_<<parameters.file_tag>> -# - store_artifacts: -# path: ~/cassandra-dtest/logs -# destination: dtest_<<parameters.file_tag>>_logs \ No newline at end of file + java11_build_and_run_tests: + jobs: + - j11_build + - start_j11_unit_tests: + type: approval + requires: + - j11_build + - j11_unit_tests: + requires: + - start_j11_unit_tests + - start_j11_dtests: + type: approval + requires: + - j11_build + - j11_dtests-with-vnodes: + requires: + - start_j11_dtests + - j11_dtests-no-vnodes: + requires: + - start_j11_dtests diff --git a/CHANGES.txt b/CHANGES.txt index 740bc21..960ed64 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 4.0 + * Support building Cassandra with JDK 11 (CASSANDRA-15108) * Use quilt to patch cassandra.in.sh in Debian packaging (CASSANDRA-14710) * Take sstable references before calculating approximate key count (CASSANDRA-14647) * Restore snapshotting of system keyspaces on version change (CASSANDRA-14412) diff --git a/build.xml b/build.xml index 4b23a25..4dac1a4 100644 --- a/build.xml +++ b/build.xml @@ -68,15 +68,6 @@ <property name="doc.dir" value="${basedir}/doc"/> - <!-- - We specify '8' instead of '1.8' in source.version to indicate that that this build requires Java 11 _and_ Java 8. - Builds that only run against Java 8, _have to_ specify '1.8' for source version. This makes it possible to let - CI scripts distinguish between "pure Java 8" releases and "hybrid" releases. - --> - <property name="source.version" value="8"/> - <property name="target.version" value="8"/> - <property name="release.version" value="10"/> - <condition property="version" value="${base.version}"> <isset property="release"/> </condition> @@ -119,11 +110,11 @@ <property name="jacoco.finalexecfile" value="${jacoco.export.dir}/jacoco.exec" /> <property name="jacoco.version" value="0.7.5.201505241946"/> - <property name="byteman.version" value="4.0.2"/> + <property name="byteman.version" value="4.0.6"/> <property name="jamm.version" value="0.3.2"/> <property name="ecj.version" value="4.6.1"/> <property name="ohc.version" value="0.5.1"/> - <property name="asm.version" value="6.2"/> + <property name="asm.version" value="7.1"/> <!-- https://mvnrepository.com/artifact/net.openhft/chronicle-bom/1.16.23 --> <property name="chronicle-queue.version" value="4.16.3" /> @@ -158,23 +149,64 @@ } </script> - <!-- - Build instructions for release builds / builds that support both Java 8 and 11: - - requires JDK 11 in JAVA_HOME - - requires JDK 8 in JAVA8_HOME - - Build instructions for development buils that only support Java 8: - - requires JDK 8 in JAVA_HOME - --> <condition property="java.version.8"> <equals arg1="${ant.java.version}" arg2="1.8"/> </condition> - <condition property="java11-jvmargs" value="-Djdk.attach.allowAttachSelf=true --add-exports java.sql/java.sql=ALL-UNNAMED --add-exports java.base/jdk.internal.misc=ALL-UNNAMED --add-opens java.base/jdk.internal.module=ALL-UNNAMED --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-exports java.base/sun.nio.ch=ALL-UNNAMED --add-exports java.management.rmi/com.sun.jmx.remote.internal.rmi=ALL-UNNAMED --add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED --add-exports java.rmi/sun.r [...] + <condition property="java.version.11"> + <not><isset property="java.version.8"/></not> + </condition> + <fail><condition><not><or> + <isset property="java.version.8"/> + <isset property="java.version.11"/> + </or></not></condition></fail> + + <resources id="_jvm11_arg_items"> + <string>-Djdk.attach.allowAttachSelf=true</string> + + <string>-XX:+UseConcMarkSweepGC</string> + <string>-XX:+CMSParallelRemarkEnabled</string> + <string>-XX:SurvivorRatio=8</string> + <string>-XX:MaxTenuringThreshold=1</string> + <string>-XX:CMSInitiatingOccupancyFraction=75</string> + <string>-XX:+UseCMSInitiatingOccupancyOnly</string> + <string>-XX:CMSWaitDuration=10000</string> + <string>-XX:+CMSParallelInitialMarkEnabled</string> + <string>-XX:+CMSEdenChunksRecordAlways</string> + + <string>--add-exports java.base/jdk.internal.misc=ALL-UNNAMED</string> + <string>--add-exports java.base/jdk.internal.ref=ALL-UNNAMED</string> + <string>--add-exports java.base/sun.nio.ch=ALL-UNNAMED</string> + <string>--add-exports java.management.rmi/com.sun.jmx.remote.internal.rmi=ALL-UNNAMED</string> + <string>--add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED</string> + <string>--add-exports java.rmi/sun.rmi.server=ALL-UNNAMED</string> + <string>--add-exports java.sql/java.sql=ALL-UNNAMED</string> + + <string>--add-opens java.base/java.lang.module=ALL-UNNAMED</string> + <string>--add-opens java.base/jdk.internal.loader=ALL-UNNAMED</string> + <string>--add-opens java.base/jdk.internal.ref=ALL-UNNAMED</string> + <string>--add-opens java.base/jdk.internal.reflect=ALL-UNNAMED</string> + <string>--add-opens java.base/jdk.internal.math=ALL-UNNAMED</string> + <string>--add-opens java.base/jdk.internal.module=ALL-UNNAMED</string> + <string>--add-opens java.base/jdk.internal.util.jar=ALL-UNNAMED</string> + <string>--add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED</string> + </resources> + <pathconvert property="_jvm_args_concat" refid="_jvm11_arg_items" pathsep=" "/> + <condition property="java11-jvmargs" value="${_jvm_args_concat}" else=""> <not> <equals arg1="${ant.java.version}" arg2="1.8"/> </not> </condition> - <property name="java11-jvmargs" value=""/> + + <condition property="build.java.11"> + <istrue value="${use.jdk11}"/> + </condition> + + <condition property="source.version" value="8" else="11"> + <equals arg1="${java.version.8}" arg2="true"/> + </condition> + <condition property="target.version" value="8" else="11"> + <equals arg1="${java.version.8}" arg2="true"/> + </condition> <!-- Add all the dependencies. @@ -221,13 +253,60 @@ </sequential> </macrodef> + <target name="validate-build-conf"> + <condition property="use-jdk11"> + <or> + <isset property="build.java.11"/> + <istrue value="${env.CASSANDRA_USE_JDK11}"/> + </or> + </condition> + <fail message="Inconsistent JDK11 options set"> + <condition> + <and> + <istrue value="${env.CASSANDRA_USE_JDK11}"/> + <isset property="use.jdk11"/> + <not> + <istrue value="${use.jdk11}"/> + </not> + </and> + </condition> + </fail> + <fail message="Inconsistent JDK11 options set"> + <condition> + <and> + <isset property="env.CASSANDRA_USE_JDK11"/> + <not> + <istrue value="${env.CASSANDRA_USE_JDK11}"/> + </not> + <istrue value="${use.jdk11}"/> + </and> + </condition> + </fail> + <fail message="-Duse.jdk11=true or $CASSANDRA_USE_JDK11=true cannot be set when building from java 8"> + <condition> + <not><or> + <not><isset property="java.version.8"/></not> + <not><isset property="use-jdk11"/></not> + </or></not> + </condition> + </fail> + <fail message="-Duse.jdk11=true or $CASSANDRA_USE_JDK11=true must be set when building from java 11"> + <condition> + <not><or> + <isset property="java.version.8"/> + <isset property="use-jdk11"/> + </or></not> + </condition> + </fail> + </target> + <!-- Setup the output directories. --> - <target name="init"> + <target name="init" depends="validate-build-conf"> <fail unless="is.source.artifact" message="Not a source artifact, stopping here." /> - <mkdir dir="${build.classes.main}/META-INF/versions/11"/> + <mkdir dir="${build.classes.main}"/> <mkdir dir="${test.lib}"/> <mkdir dir="${test.classes}"/> <mkdir dir="${stress.test.classes}"/> @@ -809,31 +888,13 @@ depends="maven-ant-tasks-retrieve-build,build-project" description="Compile Cassandra classes"/> <target name="codecoverage" depends="jacoco-run,jacoco-report" description="Create code coverage report"/> - <target name="_build_java8" if="java.version.8"> - <echo message="Compiling only for Java 8 ..."/> - <javac fork="true" - debug="true" debuglevel="${debuglevel}" encoding="utf-8" - destdir="${build.classes.main}" includeantruntime="false" source="8" target="8" - memorymaximumsize="512M"> - <src path="${build.src.java}"/> - <src path="${build.src.gen-java}"/> - <compilerarg value="-XDignore.symbol.file"/> - <classpath> - <path refid="cassandra.classpath"/> - </classpath> - </javac> - </target> - <target name="_build_java11" unless="java.version.8"> + <target name="_build_java"> <!-- Note: we cannot use javac's 'release' option, as that does not allow accessing sun.misc.Unsafe nor Nashorn's ClassFilter class as any javac modules option is invalid for relase 8. --> - <fail message="JAVA8_HOME env variable must be set when building with java >= 11"> - <condition><not><isset property="env.JAVA8_HOME"/></not></condition> - </fail> - <echo message="Compiling for Java 8 (using ${env.JAVA8_HOME}/bin/javac) ..."/> + <echo message="Compiling for Java ${target.version}..."/> <javac fork="true" debug="true" debuglevel="${debuglevel}" encoding="utf-8" - destdir="${build.classes.main}" includeantruntime="false" source="8" target="8" - executable="${env.JAVA8_HOME}/bin/javac" + destdir="${build.classes.main}" includeantruntime="false" source="${source.version}" target="${target.version}" memorymaximumsize="512M"> <src path="${build.src.java}"/> <src path="${build.src.gen-java}"/> @@ -843,12 +904,12 @@ </classpath> </javac> </target> + <target depends="init,gen-cql3-grammar,generate-cql-html,generate-jflex-java" name="build-project"> <echo message="${ant.project.name}: ${ant.file}"/> <!-- Order matters! --> - <antcall target="_build_java8"/> - <antcall target="_build_java11"/> + <antcall target="_build_java"/> <antcall target="createVersionPropFile"/> <copy todir="${build.classes.main}"> <fileset dir="${build.src.resources}" /> @@ -1217,11 +1278,10 @@ </target> <target name="build-test" depends="_main-jar, stress-build, fqltool-build, write-poms" description="Compile test classes"> - <antcall target="_build-test_java8"/> - <antcall target="_build-test_java11"/> + <antcall target="_build-test"/> </target> - <target name="_build-test_java8" if="java.version.8"> + <target name="_build-test"> <javac fork="true" compiler="modern" @@ -1249,35 +1309,6 @@ </copy> </target> - <target name="_build-test_java11" unless="java.version.8"> - <javac - fork="true" - compiler="modern" - debug="true" - debuglevel="${debuglevel}" - destdir="${test.classes}" - includeantruntime="true" - source="${source.version}" - target="${target.version}" - encoding="utf-8" - executable="${env.JAVA8_HOME}/bin/javac"> - <classpath> - <path refid="cassandra.classpath"/> - </classpath> - <compilerarg value="-XDignore.symbol.file"/> - <src path="${test.unit.src}"/> - <src path="${test.long.src}"/> - <src path="${test.burn.src}"/> - <src path="${test.microbench.src}"/> - <src path="${test.distributed.src}"/> - </javac> - - <!-- Non-java resources needed by the test suite --> - <copy todir="${test.classes}"> - <fileset dir="${test.resources}"/> - </copy> - </target> - <!-- Defines how to run a set of tests. If you change the defaults for attributes you should also update them in testmacro., The two are split because the helper doesn't generate @@ -1975,11 +2006,21 @@ </java> </target> + <target name="_maybe_update_idea_to_java11" if="java.version.11"> + <replace file="${eclipse.project.name}.iml" token="JDK_1_8" value="JDK_11"/> + <replace file=".idea/misc.xml" token="JDK_1_8" value="JDK_11"/> + <replace file=".idea/misc.xml" token="1.8" value="11"/> + <replaceregexp file=".idea/workspace.xml" + match="name="VM_PARAMETERS" value="(.*)"" + replace="name="VM_PARAMETERS" value="\1 ${java11-jvmargs}"" + byline="true"/> + </target> + <!-- Generate IDEA project description files --> <target name="generate-idea-files" depends="build-test" description="Generate IDEA files"> <mkdir dir=".idea"/> <mkdir dir=".idea/libraries"/> - <copy todir=".idea"> + <copy todir=".idea" overwrite="true"> <fileset dir="ide/idea"/> </copy> <replace file=".idea/workspace.xml" token="trunk" value="${eclipse.project.name}"/> @@ -1993,6 +2034,7 @@ </modules> </component> </project>]]></echo> + <antcall target="_maybe_update_idea_to_java11"/> </target> <!-- Generate Eclipse project description files --> diff --git a/conf/jvm11-clients.options b/conf/jvm11-clients.options index 54465db..c88b7ab 100644 --- a/conf/jvm11-clients.options +++ b/conf/jvm11-clients.options @@ -10,12 +10,20 @@ -Djdk.attach.allowAttachSelf=true --add-exports java.base/jdk.internal.misc=ALL-UNNAMED ---add-opens java.base/jdk.internal.module=ALL-UNNAMED --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-exports java.base/sun.nio.ch=ALL-UNNAMED --add-exports java.management.rmi/com.sun.jmx.remote.internal.rmi=ALL-UNNAMED --add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED --add-exports java.rmi/sun.rmi.server=ALL-UNNAMED +--add-exports java.sql/java.sql=ALL-UNNAMED + +--add-opens java.base/java.lang.module=ALL-UNNAMED +--add-opens java.base/jdk.internal.loader=ALL-UNNAMED +--add-opens java.base/jdk.internal.ref=ALL-UNNAMED +--add-opens java.base/jdk.internal.reflect=ALL-UNNAMED +--add-opens java.base/jdk.internal.math=ALL-UNNAMED +--add-opens java.base/jdk.internal.module=ALL-UNNAMED +--add-opens java.base/jdk.internal.util.jar=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED # The newline in the end of file is intentional diff --git a/conf/jvm11-server.options b/conf/jvm11-server.options index e6c2571..5fb829f 100644 --- a/conf/jvm11-server.options +++ b/conf/jvm11-server.options @@ -58,12 +58,20 @@ -Djdk.attach.allowAttachSelf=true --add-exports java.base/jdk.internal.misc=ALL-UNNAMED ---add-opens java.base/jdk.internal.module=ALL-UNNAMED --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-exports java.base/sun.nio.ch=ALL-UNNAMED --add-exports java.management.rmi/com.sun.jmx.remote.internal.rmi=ALL-UNNAMED --add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED --add-exports java.rmi/sun.rmi.server=ALL-UNNAMED +--add-exports java.sql/java.sql=ALL-UNNAMED + +--add-opens java.base/java.lang.module=ALL-UNNAMED +--add-opens java.base/jdk.internal.loader=ALL-UNNAMED +--add-opens java.base/jdk.internal.ref=ALL-UNNAMED +--add-opens java.base/jdk.internal.reflect=ALL-UNNAMED +--add-opens java.base/jdk.internal.math=ALL-UNNAMED +--add-opens java.base/jdk.internal.module=ALL-UNNAMED +--add-opens java.base/jdk.internal.util.jar=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED diff --git a/lib/asm-6.2.jar b/lib/asm-6.2.jar deleted file mode 100644 index 792142a..0000000 Binary files a/lib/asm-6.2.jar and /dev/null differ diff --git a/lib/asm-7.1.jar b/lib/asm-7.1.jar new file mode 100644 index 0000000..355eb08 Binary files /dev/null and b/lib/asm-7.1.jar differ diff --git a/src/java/org/apache/cassandra/cql3/functions/UDFByteCodeVerifier.java b/src/java/org/apache/cassandra/cql3/functions/UDFByteCodeVerifier.java index 234aed9..8910298 100644 --- a/src/java/org/apache/cassandra/cql3/functions/UDFByteCodeVerifier.java +++ b/src/java/org/apache/cassandra/cql3/functions/UDFByteCodeVerifier.java @@ -84,7 +84,7 @@ public final class UDFByteCodeVerifier { String clsNameSl = clsName.replace('.', '/'); Set<String> errors = new TreeSet<>(); // it's a TreeSet for unit tests - ClassVisitor classVisitor = new ClassVisitor(Opcodes.ASM5) + ClassVisitor classVisitor = new ClassVisitor(Opcodes.ASM7) { public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { diff --git a/src/java/org/apache/cassandra/metrics/StreamingMetrics.java b/src/java/org/apache/cassandra/metrics/StreamingMetrics.java index d220ca5..793a8c0 100644 --- a/src/java/org/apache/cassandra/metrics/StreamingMetrics.java +++ b/src/java/org/apache/cassandra/metrics/StreamingMetrics.java @@ -44,11 +44,25 @@ public class StreamingMetrics public static StreamingMetrics get(InetAddressAndPort ip) { + /* + computeIfAbsent doesn't work for this situation. Since JMX metrics register themselves in their ctor, we need + to create the metric exactly once, otherwise we'll get duplicate name exceptions. Although computeIfAbsent is + thread safe in the context of the map, it uses compare and swap to add the computed value to the map. This + means it eagerly allocates new metric instances, which can cause the jmx name collision we're trying to avoid + if multiple calls interleave. So here we use synchronized to ensure we only instantiate metrics exactly once. + */ StreamingMetrics metrics = instances.get(ip); if (metrics == null) { - metrics = new StreamingMetrics(ip); - instances.put(ip, metrics); + synchronized (instances) + { + metrics = instances.get(ip); + if (metrics == null) + { + metrics = new StreamingMetrics(ip); + instances.put(ip, metrics); + } + } } return metrics; } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org