[nginx-tests] Tests: lifted unsafe restriction on geo binary tests.

Maxim Dounin mdounin at mdounin.ru
Sun Nov 30 06:44:49 UTC 2025


details:   http://freenginx.org/hg/nginx-tests/rev/55ff381e5d3a
branches:  
changeset: 2034:55ff381e5d3a
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Sun Nov 30 06:23:01 2025 +0300
description:
Tests: lifted unsafe restriction on geo binary tests.

The restriction was originally introduced in 1044:1fe8d33f75ad to ensure
constrained startup times and not triggering waitforfile() timeout while
starting nginx.  Since then, timeout for watforfile() was raised
from 3 to 10 seconds, and the test normally works less than a second
even on relatively slow hosts, which is well under the limit.

While here, adjusted "base.conf" generation to produce a proper text file
with lines of reasonable length.

diffstat:

 geo_binary.t        |  4 +---
 stream_geo_binary.t |  4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diffs (42 lines):

diff --git a/geo_binary.t b/geo_binary.t
--- a/geo_binary.t
+++ b/geo_binary.t
@@ -22,8 +22,6 @@ use Test::Nginx;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-plan(skip_all => 'long configuration parsing') unless $ENV{TEST_NGINX_UNSAFE};
-
 my $t = Test::Nginx->new()->has(qw/http geo/);
 
 $t->write_file_expand('nginx.conf', <<'EOF');
@@ -66,7 +64,7 @@ EOF
 $t->write_file('base.conf', join('', map {
 	"127." . $_/256/256 % 256 . "." . $_/256 % 256 . "." . $_ % 256 .
 	"-127." . $_/256/256 % 256 . "." . $_/256 % 256 . "." .$_ % 256 . " " .
-	($_ == 1 ? "loopback" : "range$_") . ";" } (0 .. 100000)));
+	($_ == 1 ? "loopback" : "range$_") . ";\n" } (0 .. 100000)));
 
 $t->run();
 
diff --git a/stream_geo_binary.t b/stream_geo_binary.t
--- a/stream_geo_binary.t
+++ b/stream_geo_binary.t
@@ -23,8 +23,6 @@ use Test::Nginx::Stream qw/ stream /;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-plan(skip_all => 'long configuration parsing') unless $ENV{TEST_NGINX_UNSAFE};
-
 my $t = Test::Nginx->new()->has(qw/stream stream_return stream_geo/);
 
 $t->write_file_expand('nginx.conf', <<'EOF');
@@ -61,7 +59,7 @@ EOF
 $t->write_file('base.conf', join('', map {
 	"127." . $_/256/256 % 256 . "." . $_/256 % 256 . "." . $_ % 256 .
 	"-127." . $_/256/256 % 256 . "." . $_/256 % 256 . "." .$_ % 256 . " " .
-	($_ == 1 ? "loopback" : "range$_") . ";" } (0 .. 100000)));
+	($_ == 1 ? "loopback" : "range$_") . ";\n" } (0 .. 100000)));
 
 $t->run()->plan(2);
 


More information about the nginx-devel mailing list