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`.
This commit is contained in:
Oran Agra 2021-10-26 08:34:30 +03:00 committed by GitHub
parent 9ec3294b97
commit 665e428435
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -196,14 +196,17 @@ proc stop_instance pid {
# Node might have been stopped in the test
catch {exec kill -SIGCONT $pid}
if {$::valgrind} {
set max_wait 60000
set max_wait 120000
} else {
set max_wait 10000
}
while {[is_alive $pid]} {
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..."
catch {exec kill -KILL $pid}
} elseif {$wait % 1000 == 0} {

View File

@ -80,14 +80,17 @@ proc kill_server config {
# Node might have been stopped in the test
catch {exec kill -SIGCONT $pid}
if {$::valgrind} {
set max_wait 60000
set max_wait 120000
} else {
set max_wait 10000
}
while {[is_alive $config]} {
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..."
catch {exec kill -KILL $pid}
} elseif {$wait % 1000 == 0} {