test: nginx: Adds timeout while listening for a socket.

This commit is contained in:
Felipe Zimmerle 2014-01-16 20:22:38 -08:00
parent 215042af21
commit 8314791c9e

View File

@ -387,6 +387,9 @@ sub do_raw_request {
) or msg("Failed to connect to localhost:$opt{p}: $@");
return unless ($sock);
my $timeo = pack("qq", 2, 0);
$sock->sockopt(SO_RCVTIMEO, $timeo);
# Join togeather the request
my $r = join("", @_);
dbg($r);
@ -777,7 +780,7 @@ sub nginx_start {
}
# Look for startup msworker cycleg
unless (defined match_log("error", qr/setproctitle: "nginx: worker process"/, 60, "worker cycle")) {
unless (defined match_log("error", qr/start worker process/, 60)) {
vrb(join(" ", map { quote_shell($_) } @p));
msg("Nginx server failed to start.");
nginx_stop();