# HG changeset patch # User Sergey Kandaurov # Date 1545735411 -10800 # Node ID 5bee71e1548fd9cea629cffefff32d94185c6dd5 # Parent 29d0961bc3f786bb7c943766c8d76b9772f40667 Tests: adjusted stream udp test with failed peer. diff --git a/stream_udp_upstream.t b/stream_udp_upstream.t --- a/stream_udp_upstream.t +++ b/stream_udp_upstream.t @@ -23,7 +23,7 @@ use Test::Nginx::Stream qw/ dgram /; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/stream udp/)->plan(4) +my $t = Test::Nginx->new()->has(qw/stream udp/)->plan(5) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -95,15 +95,16 @@ my @ports = my ($port4, $port5) = (port( is(many(10, port(8980)), "$port4: 5, $port5: 5", 'balanced'); -# no next upstream for dgram - TODO: { local $TODO = 'not yet' unless $t->has_version('1.15.0'); -is(many(10, port(8981)), "$port4: 5, $port5: 4", 'failures'); +is(dgram('127.0.0.1:' . port(8981))->io('.', read_timeout => 0.5), '', + 'no next upstream for dgram'); } +is(many(10, port(8981)), "$port4: 5, $port5: 5", 'failures'); + is(many(9, port(8982)), "$port4: 3, $port5: 6", 'weight'); is(many(10, port(8983)), "$port4: 10", 'backup');