Skip to content

Commit

Permalink
Merge pull request #577 from h2o/kazuho/netstat-timeout
Browse files Browse the repository at this point in the history
limit max of server boot wait time to 1 sec
  • Loading branch information
kazuho authored Apr 19, 2024
2 parents b6e453b + 260f516 commit c499e2e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion t/e2e.t
Original file line number Diff line number Diff line change
Expand Up @@ -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]]}:$?";
}
Expand Down

0 comments on commit c499e2e

Please sign in to comment.