Tests: fix the problem that Darwin memory leak detection may fail (#8213)
Apparently the "leaks" took reports a different error string about process that's not found in each version of MacOS. This cause the test suite to fail on some OS versions, since some tests terminate the process before looking for leaks. Instead of looking at the error string, we now look at the (documented) exit code.
This commit is contained in:
parent
266949c7fc
commit
ee59dc1b5c
@ -50,11 +50,17 @@ proc kill_server config {
|
|||||||
tags {"leaks"} {
|
tags {"leaks"} {
|
||||||
test "Check for memory leaks (pid $pid)" {
|
test "Check for memory leaks (pid $pid)" {
|
||||||
set output {0 leaks}
|
set output {0 leaks}
|
||||||
catch {exec leaks $pid} output
|
catch {exec leaks $pid} output option
|
||||||
if {[string match {*process does not exist*} $output] ||
|
# In a few tests we kill the server process, so leaks will not find it.
|
||||||
[string match {*cannot examine*} $output]} {
|
# It'll exits with exit code >1 on error, so we ignore these.
|
||||||
# In a few tests we kill the server process.
|
if {[dict exists $option -errorcode]} {
|
||||||
set output "0 leaks"
|
set details [dict get $option -errorcode]
|
||||||
|
if {[lindex $details 0] eq "CHILDSTATUS"} {
|
||||||
|
set status [lindex $details 2]
|
||||||
|
if {$status > 1} {
|
||||||
|
set output "0 leaks"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
set output
|
set output
|
||||||
} {*0 leaks*}
|
} {*0 leaks*}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user