diff options
author | Oran Agra <oran@redislabs.com> | 2021-04-25 13:08:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-25 13:08:46 +0300 |
commit | 611959eee55a1fe0fa532a5f878ab5ba2b6b79c4 (patch) | |
tree | 6ae9375177ee0e8a6bd7cb1035fb17e00804ffba /tests | |
parent | 828ae842b95654f66b03e786588c97d7a0c386a2 (diff) | |
download | redis-611959eee55a1fe0fa532a5f878ab5ba2b6b79c4.tar.gz |
fuzz tester, try to print hung command (#8837)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/corrupt-dump-fuzzer.tcl | 9 | ||||
-rw-r--r-- | tests/support/util.tcl | 8 |
2 files changed, 16 insertions, 1 deletions
diff --git a/tests/integration/corrupt-dump-fuzzer.tcl b/tests/integration/corrupt-dump-fuzzer.tcl index 4fb503b8e..025b1291c 100644 --- a/tests/integration/corrupt-dump-fuzzer.tcl +++ b/tests/integration/corrupt-dump-fuzzer.tcl @@ -2,6 +2,15 @@ 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} { set rd [redis_deferring_client] for {set j 0} {$j < $elements} {incr j} { diff --git a/tests/support/util.tcl b/tests/support/util.tcl index b00aa159a..0eaee1ad0 100644 --- a/tests/support/util.tcl +++ b/tests/support/util.tcl @@ -641,6 +641,12 @@ proc generate_fuzzy_traffic_on_key {key duration} { r {*}$cmd } err ] } { 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 {}}} { $client punsubscribe {*}$channels consume_subscribe_messages $client punsubscribe $channels -}
\ No newline at end of file +} |