Skip to content

Commit 4a569c8

Browse files
committed
Check the pid in cri test teardown
Prevent the test from failing when no pid is found during teardown. Signed-off-by: Derek McGowan <[email protected]>
1 parent cb6fb93 commit 4a569c8

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

script/test/utils.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,12 @@ test_teardown() {
131131
nssm stop containerd-test
132132
nssm remove containerd-test confirm
133133
else
134-
${sudo} pkill -g $(ps -o pgid= -p "${pid}")
134+
pgid=$(ps -o pgid= -p "${pid}" || true)
135+
if [ ! -z "${pgid}" ]; then
136+
${sudo} pkill -g ${pgid}
137+
else
138+
echo "pid(${pid}) not found, skipping pkill"
139+
fi
135140
fi
136141
fi
137142
}

0 commit comments

Comments
 (0)