fuzz tester, try to print hung command (#8837)

This commit is contained in:
Oran Agra 2021-04-25 13:08:46 +03:00 committed by GitHub
parent 828ae842b9
commit 611959eee5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 15 deletions

View File

@ -14,7 +14,7 @@ jobs:
run: make REDIS_CFLAGS='-Werror' BUILD_TLS=yes run: make REDIS_CFLAGS='-Werror' BUILD_TLS=yes
- name: test - name: test
run: | run: |
sudo apt-get install tcl8.6 sudo apt-get install tcl8.6 tclx
./runtest --verbose ./runtest --verbose
- name: module api test - name: module api test
run: ./runtest-moduleapi --verbose run: ./runtest-moduleapi --verbose

View File

@ -20,7 +20,7 @@ jobs:
run: make REDIS_CFLAGS='-Werror -DREDIS_TEST' run: make REDIS_CFLAGS='-Werror -DREDIS_TEST'
- name: test - name: test
run: | run: |
sudo apt-get install tcl8.6 sudo apt-get install tcl8.6 tclx
./runtest --accurate --verbose --dump-logs ./runtest --accurate --verbose --dump-logs
- name: module api test - name: module api test
run: ./runtest-moduleapi --verbose run: ./runtest-moduleapi --verbose
@ -41,7 +41,7 @@ jobs:
run: make MALLOC=libc run: make MALLOC=libc
- name: test - name: test
run: | run: |
sudo apt-get install tcl8.6 sudo apt-get install tcl8.6 tclx
./runtest --accurate --verbose --dump-logs ./runtest --accurate --verbose --dump-logs
- name: module api test - name: module api test
run: ./runtest-moduleapi --verbose run: ./runtest-moduleapi --verbose
@ -60,7 +60,7 @@ jobs:
run: make MALLOC=libc CFLAGS=-DNO_MALLOC_USABLE_SIZE run: make MALLOC=libc CFLAGS=-DNO_MALLOC_USABLE_SIZE
- name: test - name: test
run: | run: |
sudo apt-get install tcl8.6 sudo apt-get install tcl8.6 tclx
./runtest --accurate --verbose --dump-logs ./runtest --accurate --verbose --dump-logs
- name: module api test - name: module api test
run: ./runtest-moduleapi --verbose run: ./runtest-moduleapi --verbose
@ -81,7 +81,7 @@ jobs:
make 32bit REDIS_CFLAGS='-Werror -DREDIS_TEST' make 32bit REDIS_CFLAGS='-Werror -DREDIS_TEST'
- name: test - name: test
run: | run: |
sudo apt-get install tcl8.6 sudo apt-get install tcl8.6 tclx
./runtest --accurate --verbose --dump-logs ./runtest --accurate --verbose --dump-logs
- name: module api test - name: module api test
run: | run: |
@ -105,7 +105,7 @@ jobs:
make BUILD_TLS=yes make BUILD_TLS=yes
- name: test - name: test
run: | run: |
sudo apt-get install tcl8.6 tcl-tls sudo apt-get install tcl8.6 tclx tcl-tls
./utils/gen-test-certs.sh ./utils/gen-test-certs.sh
./runtest --accurate --verbose --tls --dump-logs ./runtest --accurate --verbose --tls --dump-logs
./runtest --accurate --verbose --dump-logs ./runtest --accurate --verbose --dump-logs
@ -133,7 +133,7 @@ jobs:
make make
- name: test - name: test
run: | run: |
sudo apt-get install tcl8.6 tcl-tls sudo apt-get install tcl8.6 tclx tcl-tls
./runtest --config io-threads 4 --config io-threads-do-reads yes --accurate --verbose --tags network --dump-logs ./runtest --config io-threads 4 --config io-threads-do-reads yes --accurate --verbose --tags network --dump-logs
- name: cluster tests - name: cluster tests
run: | run: |
@ -150,7 +150,7 @@ jobs:
- name: test - name: test
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install tcl8.6 valgrind -y sudo apt-get install tcl8.6 tclx valgrind -y
./runtest --valgrind --verbose --clients 1 --dump-logs ./runtest --valgrind --verbose --clients 1 --dump-logs
- name: module api test - name: module api test
run: ./runtest-moduleapi --valgrind --no-latency --verbose --clients 1 run: ./runtest-moduleapi --valgrind --no-latency --verbose --clients 1
@ -170,7 +170,7 @@ jobs:
- name: test - name: test
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install tcl8.6 valgrind -y sudo apt-get install tcl8.6 tclx valgrind -y
./runtest --valgrind --verbose --clients 1 --dump-logs ./runtest --valgrind --verbose --clients 1 --dump-logs
- name: module api test - name: module api test
run: ./runtest-moduleapi --valgrind --no-latency --verbose --clients 1 run: ./runtest-moduleapi --valgrind --no-latency --verbose --clients 1
@ -188,7 +188,7 @@ jobs:
make make
- name: test - name: test
run: | run: |
yum -y install which tcl yum -y install which tcl tclx
./runtest --accurate --verbose --dump-logs ./runtest --accurate --verbose --dump-logs
- name: module api test - name: module api test
run: ./runtest-moduleapi --verbose run: ./runtest-moduleapi --verbose
@ -211,7 +211,7 @@ jobs:
scl enable devtoolset-7 "make BUILD_TLS=yes" scl enable devtoolset-7 "make BUILD_TLS=yes"
- name: test - name: test
run: | run: |
yum -y install tcl tcltls yum -y install tcl tcltls tclx
./utils/gen-test-certs.sh ./utils/gen-test-certs.sh
./runtest --accurate --verbose --tls --dump-logs ./runtest --accurate --verbose --tls --dump-logs
./runtest --accurate --verbose --dump-logs ./runtest --accurate --verbose --dump-logs
@ -257,7 +257,7 @@ jobs:
with: with:
usesh: true usesh: true
sync: rsync sync: rsync
prepare: pkg install -y bash gmake lang/tcl86 prepare: pkg install -y bash gmake lang/tcl86 lang/tclx
run: > run: >
gmake && gmake &&
./runtest --accurate --verbose --no-latency --dump-logs && ./runtest --accurate --verbose --no-latency --dump-logs &&
@ -277,7 +277,7 @@ jobs:
make REDIS_CFLAGS='-Werror' make REDIS_CFLAGS='-Werror'
- name: test - name: test
run: | run: |
apk add tcl procps apk add tcl procps tclx
./runtest --accurate --verbose --dump-logs ./runtest --accurate --verbose --dump-logs
- name: module api test - name: module api test
run: ./runtest-moduleapi --verbose run: ./runtest-moduleapi --verbose
@ -298,7 +298,7 @@ jobs:
make REDIS_CFLAGS='-Werror' USE_JEMALLOC=no CFLAGS=-DUSE_MALLOC_USABLE_SIZE make REDIS_CFLAGS='-Werror' USE_JEMALLOC=no CFLAGS=-DUSE_MALLOC_USABLE_SIZE
- name: test - name: test
run: | run: |
apk add tcl procps apk add tcl procps tclx
./runtest --accurate --verbose --dump-logs ./runtest --accurate --verbose --dump-logs
- name: module api test - name: module api test
run: ./runtest-moduleapi --verbose run: ./runtest-moduleapi --verbose

View File

@ -2,6 +2,15 @@
tags {"dump" "corruption"} { tags {"dump" "corruption"} {
# catch sigterm so that in case one of the random command hangs the test,
# usually due to redis not putting a response in the output buffers,
# we'll know which command it was
if { ! [ catch {
package require Tclx
} err ] } {
signal error SIGTERM
}
proc generate_collections {suffix elements} { proc generate_collections {suffix elements} {
set rd [redis_deferring_client] set rd [redis_deferring_client]
for {set j 0} {$j < $elements} {incr j} { for {set j 0} {$j < $elements} {incr j} {

View File

@ -641,6 +641,12 @@ proc generate_fuzzy_traffic_on_key {key duration} {
r {*}$cmd r {*}$cmd
} err ] } { } err ] } {
incr succeeded incr succeeded
} else {
set err [format "%s" $err] ;# convert to string for pattern matching
if {[string match "*SIGTERM*" $err]} {
puts "command caused test to hang? $cmd"
exit 1
}
} }
} }
@ -761,4 +767,4 @@ proc psubscribe {client channels} {
proc punsubscribe {client {channels {}}} { proc punsubscribe {client {channels {}}} {
$client punsubscribe {*}$channels $client punsubscribe {*}$channels
consume_subscribe_messages $client punsubscribe $channels consume_subscribe_messages $client punsubscribe $channels
} }