Unverified Commit 665e4284 authored by Oran Agra's avatar Oran Agra Committed by GitHub
Browse files

Testsuite: attempt to find / avoid valgrind warnings of killed processes (#9679)

I recently started seeing a lot of empty valgrind reports in the daily CI.
i.e. prints showing valgrind header but no leak report, which causes the tests to fail
https://github.com/redis/redis/runs/3991335416?check_suite_focus=true

This commit change 2 things:
* first, considering valgrind is just slow, we used to give processes 60 seconds timeout on shutdown
  instead of 10 seconds we give normally. this commit changes that to 120.
* secondly, when we reach the timeout, we first try to use SIGSEGV so that maybe we'll get a stack
  trace indicating where redis is hang, and we only resort to SIGKILL if double that time passed.

note that if there are indeed hang processes, we will normally not see that in the non-valgrind runs,
since the tests didn't use to detect any failure in that case, and now they will since `crashlog_from_file`
is run after `kill_server`.
parent 9ec3294b
...@@ -196,14 +196,17 @@ proc stop_instance pid { ...@@ -196,14 +196,17 @@ proc stop_instance pid {
# Node might have been stopped in the test # Node might have been stopped in the test
catch {exec kill -SIGCONT $pid} catch {exec kill -SIGCONT $pid}
if {$::valgrind} { if {$::valgrind} {
set max_wait 60000 set max_wait 120000
} else { } else {
set max_wait 10000 set max_wait 10000
} }
while {[is_alive $pid]} { while {[is_alive $pid]} {
incr wait 10 incr wait 10
if {$wait >= $max_wait} { if {$wait == $max_wait} {
puts "Forcing process $pid to crash..."
catch {exec kill -SEGV $pid}
} elseif {$wait >= $max_wait * 2} {
puts "Forcing process $pid to exit..." puts "Forcing process $pid to exit..."
catch {exec kill -KILL $pid} catch {exec kill -KILL $pid}
} elseif {$wait % 1000 == 0} { } elseif {$wait % 1000 == 0} {
......
...@@ -80,14 +80,17 @@ proc kill_server config { ...@@ -80,14 +80,17 @@ proc kill_server config {
# Node might have been stopped in the test # Node might have been stopped in the test
catch {exec kill -SIGCONT $pid} catch {exec kill -SIGCONT $pid}
if {$::valgrind} { if {$::valgrind} {
set max_wait 60000 set max_wait 120000
} else { } else {
set max_wait 10000 set max_wait 10000
} }
while {[is_alive $config]} { while {[is_alive $config]} {
incr wait 10 incr wait 10
if {$wait >= $max_wait} { if {$wait == $max_wait} {
puts "Forcing process $pid to crash..."
catch {exec kill -SEGV $pid}
} elseif {$wait >= $max_wait * 2} {
puts "Forcing process $pid to exit..." puts "Forcing process $pid to exit..."
catch {exec kill -KILL $pid} catch {exec kill -KILL $pid}
} elseif {$wait % 1000 == 0} { } elseif {$wait % 1000 == 0} {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment