diff scgi_gzip.t @ 960:d4a0232425ee

Tests: fixed race in SCGI tests.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 24 Jun 2016 16:30:08 +0300
parents e9064d691790
children 882267679006
line wrap: on
line diff
--- a/scgi_gzip.t
+++ b/scgi_gzip.t
@@ -54,7 +54,7 @@ http {
 EOF
 
 $t->run_daemon(\&scgi_daemon);
-$t->run();
+$t->run()->waitforsocket('127.0.0.1:' . port(1));
 
 ###############################################################################
 
@@ -74,7 +74,8 @@ sub scgi_daemon {
 	my $scgi = SCGI->new($server, blocking => 1);
 
 	while (my $request = $scgi->accept()) {
-		$request->read_env();
+		eval { $request->read_env(); };
+		next if $@;
 
 		$request->connection()->print(<<EOF);
 Content-Type: text/html