From: Yu Watanabe Date: Fri, 9 Sep 2022 18:21:37 +0000 (+0900) Subject: test-29-portable: set timeout for 'portablectl reattach' X-Git-Tag: v252-rc1~215 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=706c9a30accbd36254181cee5abee97cd1675f66;p=thirdparty%2Fsystemd.git test-29-portable: set timeout for 'portablectl reattach' Then, the test can fail earlier than the timeout of the whole test specified by $QEMU_TIMEOUT=. This is useful when we try to run the test multiple times. Workaround for issue #24147. --- diff --git a/test/units/testsuite-29.sh b/test/units/testsuite-29.sh index 255f36545d6..c3b68fd2789 100755 --- a/test/units/testsuite-29.sh +++ b/test/units/testsuite-29.sh @@ -47,7 +47,9 @@ systemctl is-active minimal-app0.service systemctl is-active minimal-app0-foo.service systemctl is-active minimal-app0-bar.service && exit 1 -portablectl "${ARGS[@]}" reattach --now --runtime /usr/share/minimal_1.raw minimal-app0 +# Running with sanitizers may freeze the invoked service. See issue #24147. +# Let's set timeout to improve performance. +timeout 30 portablectl "${ARGS[@]}" reattach --now --runtime /usr/share/minimal_1.raw minimal-app0 systemctl is-active minimal-app0.service systemctl is-active minimal-app0-bar.service @@ -72,7 +74,7 @@ systemctl is-active minimal-app0.service systemctl is-active minimal-app0-foo.service systemctl is-active minimal-app0-bar.service && exit 1 -portablectl "${ARGS[@]}" reattach --now --enable --runtime /tmp/minimal_1 minimal-app0 +timeout 30 portablectl "${ARGS[@]}" reattach --now --enable --runtime /tmp/minimal_1 minimal-app0 systemctl is-active minimal-app0.service systemctl is-active minimal-app0-bar.service @@ -92,7 +94,7 @@ systemctl is-active app0.service status="$(portablectl is-attached --extension app0 minimal_0)" [[ "${status}" == "running-runtime" ]] -portablectl "${ARGS[@]}" reattach --now --runtime --extension /usr/share/app0.raw /usr/share/minimal_1.raw app0 +timeout 30 portablectl "${ARGS[@]}" reattach --now --runtime --extension /usr/share/app0.raw /usr/share/minimal_1.raw app0 systemctl is-active app0.service status="$(portablectl is-attached --extension app0 minimal_1)" @@ -108,13 +110,13 @@ status="$(portablectl is-attached --extension app1 minimal_0)" # Ensure that adding or removing a version to the image doesn't break reattaching cp /usr/share/app1.raw /tmp/app1_2.raw -portablectl "${ARGS[@]}" reattach --now --runtime --extension /tmp/app1_2.raw /usr/share/minimal_1.raw app1 +timeout 30 portablectl "${ARGS[@]}" reattach --now --runtime --extension /tmp/app1_2.raw /usr/share/minimal_1.raw app1 systemctl is-active app1.service status="$(portablectl is-attached --extension app1_2 minimal_1)" [[ "${status}" == "running-runtime" ]] -portablectl "${ARGS[@]}" reattach --now --runtime --extension /usr/share/app1.raw /usr/share/minimal_1.raw app1 +timeout 30 portablectl "${ARGS[@]}" reattach --now --runtime --extension /usr/share/app1.raw /usr/share/minimal_1.raw app1 systemctl is-active app1.service status="$(portablectl is-attached --extension app1 minimal_1)"