diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2639fc579d7..8c2b4ae363d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -331,6 +331,7 @@ mysql-test-run-asan: needs: - "fedora-sanitizer: [-DWITH_ASAN=YES]" <<: *mysql-test-run-def + allow_failure: true artifacts: when: always # Also show results when tests fail reports: @@ -489,6 +490,8 @@ mini-benchmark: stage: test dependencies: - fedora + needs: + - fedora script: - ls -la rpm; rm -vf rpm/*.el?.* # Delete artifacts from Centos builds # Don't use cracklib, otherwise the Sysbench user password will be rejected @@ -503,7 +506,7 @@ mini-benchmark: - | mariadb --skip-column-names -e "SELECT @@version, @@version_comment" | tee /tmp/version grep $MARIADB_MAJOR_VERSION /tmp/version || echo "MariaDB didn't install properly" - - yum install -y sysbench procps-ng perf || yum install -y https://kojipkgs.fedoraproject.org//packages/luajit/2.0.4/3.el7/x86_64/luajit-2.0.4-3.el7.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/sysbench/1.0.17/2.el7/x86_64/sysbench-1.0.17-2.el7.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/ck/0.5.2/2.el7/x86_64/ck-0.5.2-2.el7.x86_64.rpm + - yum install -y sysbench procps-ng perf util-linux || yum install -y https://kojipkgs.fedoraproject.org//packages/luajit/2.0.4/3.el7/x86_64/luajit-2.0.4-3.el7.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/sysbench/1.0.17/2.el7/x86_64/sysbench-1.0.17-2.el7.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/ck/0.5.2/2.el7/x86_64/ck-0.5.2-2.el7.x86_64.rpm - /usr/share/mysql/mini-benchmark - cp -av */sysbench-run-*.log */metrics.txt .. # Move files one level down so they can be saved as artifacts artifacts: diff --git a/support-files/mini-benchmark.sh b/support-files/mini-benchmark.sh index d5dd194bc3f..18de6dbec51 100755 --- a/support-files/mini-benchmark.sh +++ b/support-files/mini-benchmark.sh @@ -106,16 +106,29 @@ then done | sort -u > mariadbd-dependencies.txt # shellcheck disable=SC2046 debuginfo-install -y mariadb-server $(cat mariadbd-dependencies.txt) - - echo "Using 'perf' to record performance counters in perf.data files" - PERF="perf record -g --freq=99 --output=perf.data --timestamp-filename --pid=$MARIADB_SERVER_PID --" + + if [ ! $(perf record echo "testing perf" > /dev/null 2>&1) ] + then + echo "perf does not have permission to run on this system. Skipping." + PERF="" + else + echo "Using 'perf' to record performance counters in perf.data files" + PERF="perf record -g --freq=99 --output=perf.data --timestamp-filename --pid=$MARIADB_SERVER_PID --" + fi elif [ -e /usr/bin/perf ] then # If flamegraphs were not requested, log normal perf counters if possible - echo "Using 'perf' to log basic performance counters for benchmark" + + if [ ! $(perf stat echo "testing perf" > /dev/null 2>&1) ] + then + echo "perf does not have permission to run on this system. Skipping." + PERF="" + else + echo "Using 'perf' to log basic performance counters for benchmark" + PERF="perf stat -p $MARIADB_SERVER_PID --" + fi fi - PERF="perf stat -p $MARIADB_SERVER_PID --" # Run sysbench on another CPU if system has more than one available if [ "$(nproc)" -gt 1 ] @@ -133,10 +146,10 @@ uname -a echo echo "Set highest priority for MariaDB Server process ID $MARIADB_SERVER_PID" -renice --priority -20 --pid "$MARIADB_SERVER_PID" +renice --priority -20 --pid "$MARIADB_SERVER_PID" || echo "renice failed. Not setting priority." echo "Set CPU affinity 0 for MariaDB Server process ID $MARIADB_SERVER_PID" -taskset -cp 0 "$MARIADB_SERVER_PID" +taskset -cp 0 "$MARIADB_SERVER_PID" || echo "taskset failed. Not setting cpu affinity." mariadb -e " CREATE DATABASE IF NOT EXISTS sbtest;