From: Benjamin Drung Date: Mon, 12 Jan 2026 12:16:25 +0000 (+0100) Subject: test: run QEMU with a timeout unless daemonized X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddbc224b71023685c59bcb40985e83a16ae3a626;p=thirdparty%2Fdracut-ng.git test: run QEMU with a timeout unless daemonized Dracut tests might hang. The Dracut CI sets a timeout to kill those hanging tests, but downstream might not configure something similar. Run QEMU with a timeout (unless daemonized) to avoid hanging tests forever. The slowest tests executions that I have seen on Debian/Ubuntu: * 33:44 for test 11 (5 client tests) on Ubuntu resolute on armhf * 101:58 for test 60 (19 client tests) on Debian unstable on ppc64el * 19:58 for test 70 (3 client tests) on Ubuntu resolute on arm64 * 22:35 for test 71 (4 client tests) on Ubuntu resolute on arm64 * 52:48 for test 72 (8 client tests) Debian unstable on ppc64el These slow tests take between 5:22 and 6:45 for each client tests on average (ignoring the setup cost). So set the timeout to 10 minutes as default. Fixes: https://bugs.debian.org/1121884 --- diff --git a/test/run-qemu b/test/run-qemu index 63e8a14b1..3058e6f4b 100755 --- a/test/run-qemu +++ b/test/run-qemu @@ -194,5 +194,11 @@ if [[ -n $initrd ]]; then add_to_append "console=${console:-ttyS0},115200" fi +if ! [[ $* == *-daemonize* ]] && timeout --help 2> /dev/null | grep -q -- --foreground; then + # Run QEMU with a timeout (defaut: 10min) unless daemonized + ARGS=(--foreground "${QEMU_TIMEOUT-600}" "$BIN" "${ARGS[@]}") + BIN=timeout +fi + echo "${0##*/}: $BIN $(quote_args "${ARGS[@]}")" exec "$BIN" "${ARGS[@]}"