Tests: while starting nginx monitor pidfile instead of sleeping. This reduces test execution time significantly.
diff --git a/lib/Test/Nginx.pm b/lib/Test/Nginx.pm index 2c9ecf7..26f5624 100644 --- a/lib/Test/Nginx.pm +++ b/lib/Test/Nginx.pm
@@ -97,7 +97,10 @@ # wait for nginx to start - sleep 1; + for (1 .. 30) { + select undef, undef, undef, 0.05; + last if -e "$self->{_testdir}/nginx.pid"; + } die "Can't start nginx" unless -e "$self->{_testdir}/nginx.pid";