From 4a569c8894029c858cbdad2920a85541bc89e35b Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Fri, 8 Oct 2021 11:09:09 -0700 Subject: [PATCH 1/2] Check the pid in cri test teardown Prevent the test from failing when no pid is found during teardown. Signed-off-by: Derek McGowan --- script/test/utils.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/script/test/utils.sh b/script/test/utils.sh index 677d8d635..ce6c3bd00 100755 --- a/script/test/utils.sh +++ b/script/test/utils.sh @@ -131,7 +131,12 @@ test_teardown() { nssm stop containerd-test nssm remove containerd-test confirm 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 } From d252a293df3d8fc76cb5b141e33d59fc55b94b5a Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Fri, 8 Oct 2021 13:08:13 -0700 Subject: [PATCH 2/2] Remove extra test_teardown Signed-off-by: Derek McGowan --- script/test/cri-integration.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/script/test/cri-integration.sh b/script/test/cri-integration.sh index d7abb368e..cf96b1798 100755 --- a/script/test/cri-integration.sh +++ b/script/test/cri-integration.sh @@ -46,8 +46,6 @@ ${sudo} bin/cri-integration.test --test.run="${FOCUS}" --test.v \ --containerd-bin="${CONTAINERD_BIN}" \ --image-list="${TEST_IMAGE_LIST:-}" && test_exit_code=$? || test_exit_code=$? -test_teardown - test $test_exit_code -ne 0 && \ cat "$REPORT_DIR/containerd.log"