summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2017-03-18 22:35:31 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2017-03-19 23:48:50 -0400
commitaa14493e4788f602d86defb3fa6509d41f01664b (patch)
treebb3d24fb1c3c681a2a60c8ed7a5453a63a3e8eec /tests
parent1804ccbd6da9a16600f226526e7bd61f5b01596f (diff)
downloadlighttpd1.4-aa14493e4788f602d86defb3fa6509d41f01664b.tar.gz
lighttpd1.4-aa14493e4788f602d86defb3fa6509d41f01664b.zip
[tests] reduce time waiting for backends to start
reduce time spent waiting for backends to start tests check for active listening port before proceeding test runs now complete in about 2/3 the time
Diffstat (limited to 'tests')
-rw-r--r--tests/LightyTest.pm4
-rwxr-xr-xtests/mod-fastcgi.t6
-rwxr-xr-xtests/mod-scgi.t6
3 files changed, 10 insertions, 6 deletions
diff --git a/tests/LightyTest.pm b/tests/LightyTest.pm
index f1865896..74caea1e 100644
--- a/tests/LightyTest.pm
+++ b/tests/LightyTest.pm
@@ -122,10 +122,10 @@ sub wait_for_port_with_proc {
my $self = shift;
my $port = shift;
my $child = shift;
- my $timeout = 10*10; # 10 secs (valgrind might take a while), select waits 0.1 s
+ my $timeout = 10*50; # 10 secs (valgrind might take a while), select waits 0.02 s
while (0 == $self->listening_on($port)) {
- select(undef, undef, undef, 0.1);
+ select(undef, undef, undef, 0.02);
$timeout--;
# the process is gone, we failed
diff --git a/tests/mod-fastcgi.t b/tests/mod-fastcgi.t
index 582e04fb..884acf70 100755
--- a/tests/mod-fastcgi.t
+++ b/tests/mod-fastcgi.t
@@ -410,8 +410,10 @@ EOF
ok($tf->handle_http($t) == 0, 'killing fastcgi and wait for restart');
# (might take lighttpd 1 sec to detect backend exit)
- select(undef, undef, undef, .9);
- select(undef, undef, undef, .1) while (!$tf->listening_on(10000));
+ select(undef, undef, undef, .5);
+ for (my $c = 2*20; $c && 0 == $tf->listening_on(10000); --$c) {
+ select(undef, undef, undef, 0.05);
+ }
$t->{REQUEST} = ( <<EOF
GET /index.fcgi?crlf HTTP/1.0
Host: www.example.org
diff --git a/tests/mod-scgi.t b/tests/mod-scgi.t
index 20b11482..12c11a80 100755
--- a/tests/mod-scgi.t
+++ b/tests/mod-scgi.t
@@ -76,8 +76,10 @@ EOF
ok($tf->handle_http($t) == 0, 'killing scgi and wait for restart');
# (might take lighttpd 1 sec to detect backend exit)
- select(undef, undef, undef, .9);
- select(undef, undef, undef, .1) while (!$tf->listening_on(10000));
+ select(undef, undef, undef, .5);
+ for (my $c = 2*20; $c && 0 == $tf->listening_on(10000); --$c) {
+ select(undef, undef, undef, 0.05);
+ }
$t->{REQUEST} = ( <<EOF
GET /index.scgi?crlf HTTP/1.0
Host: www.example.org