From 260f51662e9447f746c70e2f287dc4b0f6728fe4 Mon Sep 17 00:00:00 2001 From: Kazuho Oku Date: Fri, 19 Apr 2024 00:46:37 +0000 Subject: [PATCH] limit max of server boot wait time to 1 sec, as netstat on termux cannot report the correct result --- t/e2e.t | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/e2e.t b/t/e2e.t index 52faa4de..58288c3a 100755 --- a/t/e2e.t +++ b/t/e2e.t @@ -453,7 +453,10 @@ sub spawn_process { exec @$cmd; die "failed to exec @{[$cmd->[0]]}:$?"; } - while (`netstat -na` !~ /^udp.*\s(127\.0\.0\.1|0\.0\.0\.0|\*)[\.:]$listen_port\s/m) { + for (1..10) { + if (`netstat -na` =~ /^udp.*\s(127\.0\.0\.1|0\.0\.0\.0|\*)[\.:]$listen_port\s/m) { + last; + } if (waitpid($pid, WNOHANG) == $pid) { die "failed to launch @{[$cmd->[0]]}:$?"; }