summaryrefslogtreecommitdiff
path: root/tests/mod-fastcgi.t
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2021-01-01 13:44:00 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2021-01-05 12:52:11 -0500
commit5b1b9f78247e122804490b17112e94df32851464 (patch)
treee8b7580206627e5cd84e9fa4c01dcd0296344da6 /tests/mod-fastcgi.t
parent048af4c5063485b65d9919f6a7a5d28c1db02d66 (diff)
downloadlighttpd-git-5b1b9f78247e122804490b17112e94df32851464.tar.gz
[tests] use ephemeral ports in tests
avoid spurious test failures due to conflicts with ports in use by other processes, which might occur when tests use hard-coded ports
Diffstat (limited to 'tests/mod-fastcgi.t')
-rwxr-xr-xtests/mod-fastcgi.t5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/mod-fastcgi.t b/tests/mod-fastcgi.t
index 8bf846be..f90ed852 100755
--- a/tests/mod-fastcgi.t
+++ b/tests/mod-fastcgi.t
@@ -19,6 +19,9 @@ SKIP: {
unless ( -x $tf->{BASEDIR}."/tests/fcgi-responder"
|| -x $tf->{BASEDIR}."/tests/fcgi-responder.exe");
+ my $ephemeral_port = LightyTest->get_ephemeral_tcp_port();
+ $ENV{EPHEMERAL_PORT} = $ephemeral_port;
+
$tf->{CONFIGFILE} = 'fastcgi-responder.conf';
ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die();
@@ -196,7 +199,7 @@ EOF
# (might take lighttpd 1 sec to detect backend exit)
select(undef, undef, undef, .5);
- for (my $c = 2*20; $c && 0 == $tf->listening_on(10000); --$c) {
+ for (my $c = 2*20; $c && 0 == $tf->listening_on($ephemeral_port); --$c) {
select(undef, undef, undef, 0.05);
}
$t->{REQUEST} = ( <<EOF