comparison lib/Test/Nginx.pm @ 37:6cf314ec8f7b

Tests: while starting nginx monitor pidfile instead of sleeping. This reduces test execution time significantly.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 24 Oct 2008 14:42:21 +0400
parents 4f57d57543e1
children 1b3c22a87e5d
comparison
equal deleted inserted replaced
36:bd1a5e92d0c0 37:6cf314ec8f7b
95 or die "Unable to exec(): $!\n"; 95 or die "Unable to exec(): $!\n";
96 } 96 }
97 97
98 # wait for nginx to start 98 # wait for nginx to start
99 99
100 sleep 1; 100 for (1 .. 30) {
101 select undef, undef, undef, 0.05;
102 last if -e "$self->{_testdir}/nginx.pid";
103 }
101 104
102 die "Can't start nginx" unless -e "$self->{_testdir}/nginx.pid"; 105 die "Can't start nginx" unless -e "$self->{_testdir}/nginx.pid";
103 106
104 $self->{_started} = 1; 107 $self->{_started} = 1;
105 return $self; 108 return $self;