Welcome! Log In Create A New Profile

Advanced

[PATCH] Tests: stream_udp_proxy_requests adjusted

Oksana Deeva
July 15, 2024 08:04AM
# HG changeset patch
# User Oksana Deeva <o.deeva@wbsrv.ru>
# Date 1721044584 -10800
# Mon Jul 15 14:56:24 2024 +0300
# Node ID 50fc19b32628b1c5a2a49c127b013e15e4083dd6
# Parent 0e9c1a8aa1d49e57b211e2c8ece94e00bf032ed7
Tests: stream_udp_proxy_requests adjusted.

The test occasionally failed due to the fact that the order of packets
could change. Now the order of packets will be ignored.

diff -r 0e9c1a8aa1d4 -r 50fc19b32628 stream_udp_proxy_requests.t
--- a/stream_udp_proxy_requests.t Fri Jul 12 01:19:15 2024 +0400
+++ b/stream_udp_proxy_requests.t Mon Jul 15 14:56:24 2024 +0300
@@ -160,14 +160,23 @@

$s = dgram('127.0.0.1:' . port(8985));
$s->write('1') for 1 .. 5;
-$b = join ' ', map { $s->read() } (1 .. 10);
+
+my @parts = map { $s->read() } (1 .. 10);
+
+my $res = {};
+for (my $i = 0; $i < scalar @parts; $i++) {
+ my $part = $parts[$i];

-SKIP: {
-skip 'session could early terminate', 1 unless $ENV{TEST_NGINX_UNSAFE};
+ if ($i % 2 == 0) {
+ $res->{$part} //= 0;
+ } else {
+ $res->{$parts[$i-1]} += $part;
+ }
+}

-like($b, qr/^(\d+ 1) \1 (?!\1)(\d+ 1) \2 (?!\2)\d+ 1$/, 'requests - responses');
+$b = join ' ', sort values %$res;

-}
+is($b, '1 2 2', 'requests - responses');

$t->stop();

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Tests: stream_udp_proxy_requests adjusted

Oksana Deeva 199 July 15, 2024 08:04AM

Re: [PATCH] Tests: stream_udp_proxy_requests adjusted

Thorvaldur Thorvaldsson 53 July 16, 2024 06:06PM

Re: [PATCH] Tests: stream_udp_proxy_requests adjusted

Sergey Kandaurov 60 July 17, 2024 09:38AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 121
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready