Fix tests failure on busybox systems. (#7916)

(cherry picked from commit ef92f507dd0c402a916c16435e7f3f92598b7242)
This commit is contained in:
Yossi Gottlieb 2020-10-18 14:50:29 +03:00 committed by Oran Agra
parent b20af834ff
commit 79e6ab31d8
2 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ proc kill_server config {
proc is_alive config {
set pid [dict get $config pid]
if {[catch {exec ps -p $pid} err]} {
if {[catch {exec kill -0 $pid} err]} {
return 0
} else {
return 1

View File

@ -508,7 +508,7 @@ proc populate {num prefix size} {
proc get_child_pid {idx} {
set pid [srv $idx pid]
if {[string match {*Darwin*} [exec uname -a]]} {
if {[file exists "/usr/bin/pgrep"]} {
set fd [open "|pgrep -P $pid" "r"]
set child_pid [string trim [lindex [split [read $fd] \n] 0]]
} else {