From 6ec87978dea7f89b0c4bc16b9a0dd28af8b75c61 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 10 Feb 2015 14:40:27 +0100 Subject: [PATCH] Added regression test for issue #2371. --- tests/integration/logging.tcl | 24 ++++++++++++++++++++++++ tests/test_helper.tcl | 1 + 2 files changed, 25 insertions(+) create mode 100644 tests/integration/logging.tcl diff --git a/tests/integration/logging.tcl b/tests/integration/logging.tcl new file mode 100644 index 00000000..c1f4854d --- /dev/null +++ b/tests/integration/logging.tcl @@ -0,0 +1,24 @@ +set server_path [tmpdir server.log] +set system_name [string tolower [exec uname -s]] + +if {$system_name eq {linux} || $system_name eq {darwin}} { + start_server [list overrides [list dir $server_path]] { + test "Server is able to generate a stack trace on selected systems" { + r config set watchdog-period 200 + r debug sleep 1 + set pattern "*debugCommand*" + set retry 10 + while {$retry} { + set result [exec tail -100 < [srv 0 stdout]] + if {[string match $pattern $result]} { + break + } + incr retry -1 + after 1000 + } + if {$retry == 0} { + error "assertion:expected stack trace not found into log file" + } + } + } +} diff --git a/tests/test_helper.tcl b/tests/test_helper.tcl index 212c95b4..7e9e2cfa 100644 --- a/tests/test_helper.tcl +++ b/tests/test_helper.tcl @@ -38,6 +38,7 @@ set ::all_tests { integration/aof integration/rdb integration/convert-zipmap-hash-on-load + integration/logging unit/pubsub unit/slowlog unit/scripting -- GitLab