comparison stream_udp_limit_rate.t @ 1432:d17fb72140f2

Tests: adjusted stream_udp_limit_rate.t for slow hosts. Upload could not be limited if some time passed between 1st and 2nd datagrams.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 18 Jan 2019 16:05:23 +0300
parents aab729315dca
children 3e0dcf1e7752
comparison
equal deleted inserted replaced
1431:aab729315dca 1432:d17fb72140f2
49 } 49 }
50 50
51 server { 51 server {
52 listen 127.0.0.1:%%PORT_8984_UDP%% udp; 52 listen 127.0.0.1:%%PORT_8984_UDP%% udp;
53 proxy_pass 127.0.0.1:%%PORT_8980_UDP%%; 53 proxy_pass 127.0.0.1:%%PORT_8980_UDP%%;
54 proxy_upload_rate 1000; 54 proxy_upload_rate 500;
55 } 55 }
56 } 56 }
57 57
58 EOF 58 EOF
59 59
83 83
84 $s = dgram('127.0.0.1:' . port(8984)); 84 $s = dgram('127.0.0.1:' . port(8984));
85 is($s->io($str), $str, 'upload'); 85 is($s->io($str), $str, 'upload');
86 is($s->io($str, read_timeout => 0.5), '', 'upload limited'); 86 is($s->io($str, read_timeout => 0.5), '', 'upload limited');
87 87
88 select undef, undef, undef, 0.6; 88 select undef, undef, undef, 1.6;
89 is($s->io($str), $str, 'upload passed'); 89 is($s->io($str), $str, 'upload passed');
90 90
91 ############################################################################### 91 ###############################################################################
92 92
93 sub udp_daemon { 93 sub udp_daemon {