[PATCH] Tests: lifted unsafe restriction on geo binary tests
Maxim Dounin
mdounin at mdounin.ru
Wed Nov 19 14:11:27 UTC 2025
# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1763561013 -10800
# Wed Nov 19 17:03:33 2025 +0300
# Node ID c8f7c3ada8991c29972c6f669d410bd6f07333ef
# Parent 5ab28d1964976d4e5c0ad45ddd47d822e1091bc8
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.
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