From: Bobby Eshleman Date: Sat, 8 Nov 2025 16:00:57 +0000 (-0800) Subject: selftests/vsock: speed up tests by reducing the QEMU pidfile timeout X-Git-Tag: v6.19-rc1~170^2~185^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e2ad0bc3640c384799c91da0b8b794c672da4d3;p=thirdparty%2Fkernel%2Flinux.git selftests/vsock: speed up tests by reducing the QEMU pidfile timeout Reduce the time waiting for the QEMU pidfile from three minutes to five seconds. The three minute time window was chosen to make sure QEMU had enough time to fully boot up. This, however, is an unreasonably long delay for QEMU to write the pidfile, which happens earlier when the QEMU process starts (not after VM boot). The three minute delay becomes noticeably wasteful in future tests that expect QEMU to fail and wait a full three minutes for a pidfile that will never exist. Reviewed-by: Simon Horman Signed-off-by: Bobby Eshleman Reviewed-by: Stefano Garzarella Link: https://patch.msgid.link/20251108-vsock-selftests-fixes-and-improvements-v4-6-d5e8d6c87289@meta.com Signed-off-by: Jakub Kicinski --- diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh index 6889bdb8a31c5..bd231467c66b3 100755 --- a/tools/testing/selftests/vsock/vmtest.sh +++ b/tools/testing/selftests/vsock/vmtest.sh @@ -22,7 +22,7 @@ readonly SSH_HOST_PORT=2222 readonly VSOCK_CID=1234 readonly WAIT_PERIOD=3 readonly WAIT_PERIOD_MAX=60 -readonly WAIT_TOTAL=$(( WAIT_PERIOD * WAIT_PERIOD_MAX )) +readonly WAIT_QEMU=5 readonly PIDFILE_TEMPLATE=/tmp/vsock_vmtest_XXXX.pid declare -A PIDFILES @@ -236,7 +236,7 @@ vm_start() { --append "${KERNEL_CMDLINE}" \ --rw &> ${logfile} & - timeout "${WAIT_TOTAL}" \ + timeout "${WAIT_QEMU}" \ bash -c 'while [[ ! -s '"${pidfile}"' ]]; do sleep 1; done; exit 0' }