Check the pid in cri test teardown
Prevent the test from failing when no pid is found during teardown. Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
		| @@ -131,7 +131,12 @@ test_teardown() { | |||||||
|       nssm stop containerd-test |       nssm stop containerd-test | ||||||
|       nssm remove containerd-test confirm |       nssm remove containerd-test confirm | ||||||
|     else |     else | ||||||
|       ${sudo} pkill -g $(ps -o pgid= -p "${pid}") |       pgid=$(ps -o pgid= -p "${pid}" || true) | ||||||
|  |       if [ ! -z "${pgid}" ]; then | ||||||
|  |         ${sudo} pkill -g ${pgid} | ||||||
|  |       else | ||||||
|  |         echo "pid(${pid}) not found, skipping pkill" | ||||||
|  |       fi | ||||||
|     fi |     fi | ||||||
|   fi |   fi | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Derek McGowan
					Derek McGowan