# HG changeset patch # User Maxim Dounin # Date 1224844941 -14400 # Node ID 6cf314ec8f7b6417d081874270c50dd49522ee7a # Parent bd1a5e92d0c0b41c7d1dcb790fe364a6f0ac6db7 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 --- a/lib/Test/Nginx.pm +++ b/lib/Test/Nginx.pm @@ -97,7 +97,10 @@ sub run(;$) { # 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";