Commit 6693862f authored by Michal Berger's avatar Michal Berger Committed by Ben Walker
Browse files

autotest: Consider processes from deleted workspaces during cleanup



Common practice is to purge workspace on the jenkins side when the
job is done. When that happens, stuck processes may still linger,
but readlink -f will fail to resolve exe link as the target binary
won't exist anymore. Instead, just see what the link points at
and include it in the list.

Signed-off-by: default avatarMichal Berger <michal.berger@intel.com>
Change-Id: I437a720e12e43e33fbf04345a6b77987167864fe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17050


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 6b7cca15
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1562,10 +1562,11 @@ function pap() {
function get_proc_paths() {
	case "$(uname -s)" in
		Linux) # ps -e -opid,exe <- not supported under {centos7,rocky8}'s procps-ng
			local pid
			local pid exe
			for pid in /proc/[0-9]*; do
				[[ -e $pid/exe ]] || continue
				echo "${pid##*/} $(readlink -f "$pid/exe")"
				exe=$(readlink "$pid/exe") || continue
				exe=${exe/ (deleted)/}
				echo "${pid##*/} $exe"
			done
			;;
		FreeeBSD) procstat -ab | awk '{print $1, $4}' ;;