From 97f0f829107d35448d49e86997b163362d8f4ea6 Mon Sep 17 00:00:00 2001 From: Carlos Nihelton Date: Thu, 16 Jun 2022 16:43:44 -0300 Subject: [PATCH 1/2] Avoid integration to fail due TCP server timeout timeout 60 might be too short for someone with lots of network interfaces. Since we grab the PID and run the server in the background, the timeout is not critically necessary. --- scripts/runtests.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/runtests.sh b/scripts/runtests.sh index 982c66c0..982f4743 100755 --- a/scripts/runtests.sh +++ b/scripts/runtests.sh @@ -234,8 +234,7 @@ if [ "${RELEASE%.*}" -ge 20 ]; then # Test TCP connectivity (system_setup only) clean port=50321 - LANG=C.UTF-8 timeout --foreground 60 \ - python3 -m system_setup.cmd.server --dry-run --tcp-port=$port & + LANG=C.UTF-8 python3 -m system_setup.cmd.server --dry-run --tcp-port=$port & subiquity_pid=$! next_time=3 until [ $next_time -eq 0 ] || [ ! -z "$(ss -Hlt sport = $port)" ]; do @@ -268,7 +267,7 @@ if [ "${RELEASE%.*}" -ge 20 ]; then fi done done - kill $subiquity_pid + kill $subiquity_pid || true if [ $loopback_failed -ne 0 ]; then echo "Loopback was expected to connect" exit 1 From d7697c0d0f6bc3a993ef7717b8b4d0930ef15aa6 Mon Sep 17 00:00:00 2001 From: Carlos Nihelton Date: Thu, 16 Jun 2022 17:29:44 -0300 Subject: [PATCH 2/2] Without the timeout another kill is necessary otherwise the process could stay running if the first `exit 1` after its start was taken. --- scripts/runtests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/runtests.sh b/scripts/runtests.sh index 982f4743..1e9e4faf 100755 --- a/scripts/runtests.sh +++ b/scripts/runtests.sh @@ -242,6 +242,7 @@ if [ "${RELEASE%.*}" -ge 20 ]; then done if [ $next_time -eq 0 ]; then echo "Timeout reached before Subiquity TCP socket started listening" + kill $subiquity_pid || true exit 1 fi loopback_failed=0