diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5e3a97c62f..680b1f0355a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,6 @@ jobs: run: | apt-get update && apt-get install -y build-essential make REDIS_CFLAGS='-Werror' - build-macos-latest: runs-on: macos-latest steps: @@ -44,7 +43,6 @@ jobs: run: | sudo apt-get update && sudo apt-get install libc6-dev-i386 make REDIS_CFLAGS='-Werror' 32bit - build-libc-malloc: runs-on: ubuntu-latest steps: @@ -61,3 +59,301 @@ jobs: run: | yum -y install gcc make make REDIS_CFLAGS='-Werror' + test-ubuntu-jemalloc: + runs-on: ubuntu-latest + if: github.repository == 'hwware/redis' + timeout-minutes: 14400 + steps: + - uses: actions/checkout@v2 + - name: make + run: make REDIS_CFLAGS='-Werror -DREDIS_TEST' + - name: testprep + run: sudo apt-get install tcl8.6 tclx + - name: test + run: ./runtest --accurate --verbose --dump-logs + - name: module api test + run: ./runtest-moduleapi --verbose + - name: sentinel tests + run: ./runtest-sentinel + - name: cluster tests + run: ./runtest-cluster + - name: unittest + run: ./src/redis-server test all + + test-ubuntu-libc-malloc: + runs-on: ubuntu-latest + if: github.repository == 'hwware/redis' + timeout-minutes: 14400 + steps: + - uses: actions/checkout@v2 + - name: make + run: make MALLOC=libc + - name: testprep + run: sudo apt-get install tcl8.6 tclx + - name: test + run: ./runtest --accurate --verbose --dump-logs + - name: module api test + run: ./runtest-moduleapi --verbose + - name: sentinel tests + run: ./runtest-sentinel + - name: cluster tests + run: ./runtest-cluster + + test-ubuntu-no-malloc-usable-size: + runs-on: ubuntu-latest + if: github.repository == 'hwware/redis' + timeout-minutes: 14400 + steps: + - uses: actions/checkout@v2 + - name: make + run: make MALLOC=libc CFLAGS=-DNO_MALLOC_USABLE_SIZE + - name: testprep + run: sudo apt-get install tcl8.6 tclx + - name: test + run: ./runtest --accurate --verbose --dump-logs + - name: module api test + run: ./runtest-moduleapi --verbose + - name: sentinel tests + run: ./runtest-sentinel + - name: cluster tests + run: ./runtest-cluster + + test-ubuntu-32bit: + runs-on: ubuntu-latest + if: github.repository == 'hwware/redis' + timeout-minutes: 14400 + steps: + - uses: actions/checkout@v2 + - name: make + run: | + sudo apt-get update && sudo apt-get install libc6-dev-i386 + make 32bit REDIS_CFLAGS='-Werror -DREDIS_TEST' + - name: testprep + run: sudo apt-get install tcl8.6 tclx + - name: test + run: ./runtest --accurate --verbose --dump-logs + - name: module api test + run: | + make -C tests/modules 32bit + ./runtest-moduleapi --verbose + - name: sentinel tests + run: ./runtest-sentinel + - name: cluster tests + run: ./runtest-cluster + - name: unittest + run: ./src/redis-server test all + + test-ubuntu-tls: + runs-on: ubuntu-latest + if: github.repository == 'hwware/redis' + timeout-minutes: 14400 + steps: + - uses: actions/checkout@v2 + - name: make + run: | + make BUILD_TLS=yes + - name: testprep + run: | + sudo apt-get install tcl8.6 tclx tcl-tls + ./utils/gen-test-certs.sh + - name: test + run: | + ./runtest --accurate --verbose --tls --dump-logs + ./runtest --accurate --verbose --dump-logs + - name: module api test + run: | + ./runtest-moduleapi --verbose --tls + ./runtest-moduleapi --verbose + - name: sentinel tests + run: | + ./runtest-sentinel --tls + ./runtest-sentinel + - name: cluster tests + run: | + ./runtest-cluster --tls + ./runtest-cluster + + test-ubuntu-io-threads: + runs-on: ubuntu-latest + if: github.repository == 'hwware/redis' + timeout-minutes: 14400 + steps: + - uses: actions/checkout@v2 + - name: make + run: | + make + - name: testprep + run: sudo apt-get install tcl8.6 tclx + - name: test + run: ./runtest --config io-threads 4 --config io-threads-do-reads yes --accurate --verbose --tags network --dump-logs + - name: cluster tests + run: ./runtest-cluster --config io-threads 4 --config io-threads-do-reads yes + + test-valgrind: + runs-on: ubuntu-latest + if: github.repository == 'hwware/redis' + timeout-minutes: 14400 + steps: + - uses: actions/checkout@v2 + - name: make + run: make valgrind REDIS_CFLAGS='-Werror -DREDIS_TEST' + - name: testprep + run: | + sudo apt-get update + sudo apt-get install tcl8.6 tclx valgrind -y + - name: test + run: ./runtest --valgrind --verbose --clients 1 --tags -large-memory --dump-logs + - name: module api test + run: ./runtest-moduleapi --valgrind --no-latency --verbose --clients 1 + - name: unittest + run: | + valgrind --track-origins=yes --suppressions=./src/valgrind.sup --show-reachable=no --show-possibly-lost=no --leak-check=full --log-file=err.txt ./src/redis-server test all + if grep -q 0x err.txt; then cat err.txt; exit 1; fi + + test-valgrind-no-malloc-usable-size: + runs-on: ubuntu-latest + if: github.repository == 'hwware/redis' + timeout-minutes: 14400 + steps: + - uses: actions/checkout@v2 + - name: make + run: make valgrind CFLAGS="-DNO_MALLOC_USABLE_SIZE" + - name: testprep + run: | + sudo apt-get update + sudo apt-get install tcl8.6 tclx valgrind -y + - name: test + run: ./runtest --valgrind --verbose --clients 1 --tags -large-memory --dump-logs + - name: module api test + run: ./runtest-moduleapi --valgrind --no-latency --verbose --clients 1 + + test-centos7-jemalloc: + runs-on: ubuntu-latest + if: github.repository == 'hwware/redis' + container: centos:7 + timeout-minutes: 14400 + steps: + - uses: actions/checkout@v2 + - name: make + run: | + yum -y install gcc make + make + - name: testprep + run: yum -y install which tcl tclx + - name: test + run: ./runtest --accurate --verbose --dump-logs + - name: module api test + run: ./runtest-moduleapi --verbose + - name: sentinel tests + run: ./runtest-sentinel + - name: cluster tests + run: ./runtest-cluster + + test-centos7-tls: + runs-on: ubuntu-latest + if: github.repository == 'hwware/redis' + container: centos:7 + timeout-minutes: 14400 + steps: + - uses: actions/checkout@v2 + - name: make + run: | + yum -y install centos-release-scl epel-release + yum -y install devtoolset-7 openssl-devel openssl + scl enable devtoolset-7 "make BUILD_TLS=yes" + - name: testprep + run: | + yum -y install tcl tcltls tclx + ./utils/gen-test-certs.sh + - name: test + run: | + ./runtest --accurate --verbose --tls --dump-logs + ./runtest --accurate --verbose --dump-logs + - name: module api test + run: | + ./runtest-moduleapi --verbose --tls + ./runtest-moduleapi --verbose + - name: sentinel tests + run: | + ./runtest-sentinel --tls + ./runtest-sentinel + - name: cluster tests + run: | + ./runtest-cluster --tls + ./runtest-cluster + test-macos-latest: + runs-on: macos-latest + if: github.repository == 'hwware/redis' + timeout-minutes: 14400 + steps: + - uses: actions/checkout@v2 + - name: make + run: make + - name: test + run: ./runtest --accurate --verbose --no-latency --dump-logs + - name: module api test + run: ./runtest-moduleapi --verbose + - name: sentinel tests + run: ./runtest-sentinel + - name: cluster tests + run: ./runtest-cluster + + test-freebsd: + runs-on: macos-latest + if: github.repository == 'hwware/redis' + timeout-minutes: 14400 + steps: + - uses: actions/checkout@v2 + - name: test + uses: vmactions/freebsd-vm@v0.1.4 + with: + usesh: true + sync: rsync + prepare: pkg install -y bash gmake lang/tcl86 lang/tclx + run: > + gmake || exit 1 ; + if true ; then ./runtest --accurate --verbose --no-latency --tags -large-memory --dump-logs || exit 1 ; fi ; + if true ; then MAKE=gmake ./runtest-moduleapi --verbose || exit 1 ; fi ; + if true ; then ./runtest-sentinel || exit 1 ; fi ; + if true ; then ./runtest-cluster || exit 1 ; fi ; + test-alpine-jemalloc: + runs-on: ubuntu-latest + if: github.repository == 'hwware/redis' + container: alpine:latest + steps: + - uses: actions/checkout@v2 + - name: make + run: | + apk add build-base + make REDIS_CFLAGS='-Werror' + - name: testprep + run: apk add tcl procps tclx + - name: test + run: ./runtest --accurate --verbose --dump-logs + - name: module api test + run: ./runtest-moduleapi --verbose + - name: sentinel tests + run: ./runtest-sentinel + - name: cluster tests + run: ./runtest-cluster + + test-alpine-libc-malloc: + runs-on: ubuntu-latest + if: github.repository == 'hwware/redis' + container: alpine:latest + steps: + - uses: actions/checkout@v2 + - name: make + run: | + apk add build-base + make REDIS_CFLAGS='-Werror' USE_JEMALLOC=no CFLAGS=-DUSE_MALLOC_USABLE_SIZE + - name: testprep + run: apk add tcl procps tclx + - name: test + run: ./runtest --accurate --verbose --dump-logs + - name: module api test + run: ./runtest-moduleapi --verbose + - name: sentinel tests + run: ./runtest-sentinel + - name: cluster tests + run: ./runtest-cluster \ No newline at end of file diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 80001650876..fd502d39175 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -23,7 +23,7 @@ on: default: '' use_repo: description: 'repo owner and name' - default: 'redis/redis' + default: 'hwware/redis' use_git_ref: description: 'git branch or sha to use' default: 'unstable' @@ -33,7 +33,7 @@ jobs: test-ubuntu-jemalloc: runs-on: ubuntu-latest - if: github.repository == 'redis/redis' + if: github.repository == 'hwware/redis' timeout-minutes: 14400 steps: - name: prep @@ -67,7 +67,7 @@ jobs: test-ubuntu-libc-malloc: runs-on: ubuntu-latest - if: github.repository == 'redis/redis' + if: github.repository == 'hwware/redis' timeout-minutes: 14400 steps: - name: prep @@ -98,7 +98,7 @@ jobs: test-ubuntu-no-malloc-usable-size: runs-on: ubuntu-latest - if: github.repository == 'redis/redis' + if: github.repository == 'hwware/redis' timeout-minutes: 14400 steps: - name: prep @@ -129,7 +129,7 @@ jobs: test-ubuntu-32bit: runs-on: ubuntu-latest - if: github.repository == 'redis/redis' && !contains(github.event.inputs.skipjobs, '32bit') + if: github.repository == 'hwware/redis' && !contains(github.event.inputs.skipjobs, '32bit') timeout-minutes: 14400 steps: - name: prep @@ -166,7 +166,7 @@ jobs: test-ubuntu-tls: runs-on: ubuntu-latest - if: github.repository == 'redis/redis' && !contains(github.event.inputs.skipjobs, 'tls') + if: github.repository == 'hwware/redis' && !contains(github.event.inputs.skipjobs, 'tls') timeout-minutes: 14400 steps: - name: prep @@ -208,7 +208,7 @@ jobs: test-ubuntu-io-threads: runs-on: ubuntu-latest - if: github.repository == 'redis/redis' && !contains(github.event.inputs.skipjobs, 'iothreads') + if: github.repository == 'hwware/redis' && !contains(github.event.inputs.skipjobs, 'iothreads') timeout-minutes: 14400 steps: - name: prep @@ -234,7 +234,7 @@ jobs: test-valgrind: runs-on: ubuntu-latest - if: github.repository == 'redis/redis' && !contains(github.event.inputs.skipjobs, 'valgrind') + if: github.repository == 'hwware/redis' && !contains(github.event.inputs.skipjobs, 'valgrind') timeout-minutes: 14400 steps: - name: prep @@ -265,7 +265,7 @@ jobs: test-valgrind-no-malloc-usable-size: runs-on: ubuntu-latest - if: github.repository == 'redis/redis' && !contains(github.event.inputs.skipjobs, 'valgrind') + if: github.repository == 'hwware/redis' && !contains(github.event.inputs.skipjobs, 'valgrind') timeout-minutes: 14400 steps: - name: prep @@ -292,7 +292,7 @@ jobs: test-centos7-jemalloc: runs-on: ubuntu-latest - if: github.repository == 'redis/redis' + if: github.repository == 'hwware/redis' container: centos:7 timeout-minutes: 14400 steps: @@ -326,7 +326,7 @@ jobs: test-centos7-tls: runs-on: ubuntu-latest - if: github.repository == 'redis/redis' && !contains(github.event.inputs.skipjobs, 'tls') + if: github.repository == 'hwware/redis' && !contains(github.event.inputs.skipjobs, 'tls') container: centos:7 timeout-minutes: 14400 steps: @@ -371,7 +371,7 @@ jobs: test-macos-latest: runs-on: macos-latest - if: github.repository == 'redis/redis' && !contains(github.event.inputs.skipjobs, 'macos') + if: github.repository == 'hwware/redis' && !contains(github.event.inputs.skipjobs, 'macos') timeout-minutes: 14400 steps: - name: prep @@ -400,7 +400,7 @@ jobs: test-freebsd: runs-on: macos-latest - if: github.repository == 'redis/redis' && !contains(github.event.inputs.skipjobs, 'freebsd') + if: github.repository == 'hwware/redis' && !contains(github.event.inputs.skipjobs, 'freebsd') timeout-minutes: 14400 steps: - name: prep @@ -427,7 +427,7 @@ jobs: test-alpine-jemalloc: runs-on: ubuntu-latest - if: github.repository == 'redis/redis' && !contains(github.event.inputs.skipjobs, 'alpine') + if: github.repository == 'hwware/redis' && !contains(github.event.inputs.skipjobs, 'alpine') container: alpine:latest steps: - name: prep @@ -460,7 +460,7 @@ jobs: test-alpine-libc-malloc: runs-on: ubuntu-latest - if: github.repository == 'redis/redis' && !contains(github.event.inputs.skipjobs, 'alpine') + if: github.repository == 'hwware/redis' && !contains(github.event.inputs.skipjobs, 'alpine') container: alpine:latest steps: - name: prep diff --git a/tests/sentinel/tests/00-base.tcl b/tests/sentinel/tests/00-base.tcl index f00efc61e37..7b4d49b57e5 100644 --- a/tests/sentinel/tests/00-base.tcl +++ b/tests/sentinel/tests/00-base.tcl @@ -18,9 +18,10 @@ test "Basic failover works if the master is down" { assert {[lindex $addr 1] == $old_port} kill_instance redis $master_id foreach_sentinel_id id { - S $id sentinel debug ping-period 100 - S $id sentinel debug ask-period 100 - wait_for_condition 1000 50 { + S $id sentinel debug ping-period 500 + S $id sentinel debug ask-period 500 + + wait_for_condition 1000 100 { [lindex [S $id SENTINEL GET-MASTER-ADDR-BY-NAME mymaster] 1] != $old_port } else { fail "At least one Sentinel did not receive failover info" @@ -101,7 +102,7 @@ test "Failover works if we configure for absolute agreement" { # Wait for Sentinels to monitor the master again foreach_sentinel_id id { - wait_for_condition 1000 50 { + wait_for_condition 1000 100 { [dict get [S $id SENTINEL MASTER mymaster] info-refresh] < 100000 } else { fail "At least one Sentinel is not monitoring the master" @@ -111,7 +112,7 @@ test "Failover works if we configure for absolute agreement" { kill_instance redis $master_id foreach_sentinel_id id { - wait_for_condition 1000 50 { + wait_for_condition 1000 100 { [lindex [S $id SENTINEL GET-MASTER-ADDR-BY-NAME mymaster] 1] != $old_port } else { fail "At least one Sentinel did not receive failover info" diff --git a/tests/sentinel/tests/02-slaves-reconf.tcl b/tests/sentinel/tests/02-slaves-reconf.tcl index 8196b60fac3..9edf775ecae 100644 --- a/tests/sentinel/tests/02-slaves-reconf.tcl +++ b/tests/sentinel/tests/02-slaves-reconf.tcl @@ -48,13 +48,6 @@ proc 02_crash_and_failover {} { 02_test_slaves_replication 02_crash_and_failover - -foreach_sentinel_id id { - S $id sentinel debug info-period 100 - S $id sentinel debug default-down-after 1000 - S $id sentinel debug publish-period 100 -} - 02_test_slaves_replication test "Kill a slave instance" { diff --git a/tests/sentinel/tests/07-down-conditions.tcl b/tests/sentinel/tests/07-down-conditions.tcl index 2c72f85470b..92d95c3ab2c 100644 --- a/tests/sentinel/tests/07-down-conditions.tcl +++ b/tests/sentinel/tests/07-down-conditions.tcl @@ -3,12 +3,16 @@ source "../tests/includes/init-tests.tcl" source "../../../tests/support/cli.tcl" +foreach_sentinel_id id { + S $id sentinel debug info-period 1000 + S $id sentinel debug ask-period 100 + S $id sentinel debug default-down-after 3000 + S $id sentinel debug publish-period 200 + S $id sentinel debug ping-period 100 +} + set ::alive_sentinel [expr {$::instances_count/2+2}] proc ensure_master_up {} { - S $::alive_sentinel sentinel debug info-period 1000 - S $::alive_sentinel sentinel debug ping-period 100 - S $::alive_sentinel sentinel debug ask-period 100 - S $::alive_sentinel sentinel debug publish-period 100 wait_for_condition 1000 50 { [dict get [S $::alive_sentinel sentinel master mymaster] flags] eq "master" } else { @@ -16,12 +20,7 @@ proc ensure_master_up {} { } } - proc ensure_master_down {} { - S $::alive_sentinel sentinel debug info-period 1000 - S $::alive_sentinel sentinel debug ping-period 100 - S $::alive_sentinel sentinel debug ask-period 100 - S $::alive_sentinel sentinel debug publish-period 100 wait_for_condition 1000 50 { [string match *down* \ [dict get [S $::alive_sentinel sentinel master mymaster] flags]] @@ -69,7 +68,9 @@ test "SDOWN is triggered by misconfigured instance replying with errors" { R 0 config set dir / R 0 config set dbfilename tmp R 0 config set save "1000000 1000000" + after 5000 R 0 bgsave + after 5000 ensure_master_down R 0 config set save $orig_save R 0 config set dir $orig_dir