[nginx-tests] Tests: removed bytes sent tests on rejected connec...
Maxim Dounin
mdounin at mdounin.ru
Mon Aug 18 00:31:03 UTC 2025
details: http://freenginx.org/hg/nginx-tests/rev/d7a61ea0f425
branches:
changeset: 2018:d7a61ea0f425
user: Maxim Dounin <mdounin at mdounin.ru>
date: Mon Aug 18 03:28:29 2025 +0300
description:
Tests: removed bytes sent tests on rejected connection upgrades.
In proxy_upgrade.t and ssl_proxy_upgrade.t, $body_bytes_sent was expected
to be 0 if connection upgrade was not requested by the client, yet the
upstream server tried to return 101 (Switching Protocols). This is,
however, not the only possible valid outcome. In particular, if such
a response is considered to be an error, and 502 (Bad Gateway) is generated,
$body_bytes_sent won't be 0, breaking the test. As such, these tests
were removed.
diffstat:
proxy_upgrade.t | 3 +--
ssl_proxy_upgrade.t | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diffs (40 lines):
diff --git a/proxy_upgrade.t b/proxy_upgrade.t
--- a/proxy_upgrade.t
+++ b/proxy_upgrade.t
@@ -28,7 +28,7 @@ select STDERR; $| = 1;
select STDOUT; $| = 1;
my $t = Test::Nginx->new()->has(qw/http proxy ssi/)
- ->write_file_expand('nginx.conf', <<'EOF')->plan(31);
+ ->write_file_expand('nginx.conf', <<'EOF')->plan(30);
%%TEST_GLOBALS%%
@@ -149,7 +149,6 @@ open my $f, '<', "$d/cc.log" or die "Can
is($f->getline(), shift (@r) . " 540793 upgrade\n", 'log - bytes');
is($f->getline(), shift (@r) . " 22 upgrade\n", 'log - bytes pipelined');
-like($f->getline(), qr/\d+ 0 /, 'log - bytes noupgrade');
###############################################################################
diff --git a/ssl_proxy_upgrade.t b/ssl_proxy_upgrade.t
--- a/ssl_proxy_upgrade.t
+++ b/ssl_proxy_upgrade.t
@@ -31,7 +31,7 @@ select STDOUT; $| = 1;
my $t = Test::Nginx->new()->has(qw/http proxy http_ssl socket_ssl/)
->has_daemon('openssl')
- ->write_file_expand('nginx.conf', <<'EOF')->plan(30);
+ ->write_file_expand('nginx.conf', <<'EOF')->plan(29);
%%TEST_GLOBALS%%
@@ -160,7 +160,6 @@ open my $f, '<', "$d/cc.log" or die "Can
is($f->getline(), shift (@r) . " 540793\n", 'log - bytes');
is($f->getline(), shift (@r) . " 22\n", 'log - bytes pipelined');
-like($f->getline(), qr/\d+ 0\n/, 'log - bytes noupgrade');
###############################################################################
More information about the nginx-devel
mailing list