Mercurial > hg > nginx-tests
changeset 1401:2b461d4af65f
Tests: adjusted upstream response time tests for upcoming changes.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 21 Nov 2018 13:37:01 +0300 |
parents | 94bcad5611af |
children | db77d757ded4 |
files | proxy_variables.t |
diffstat | 1 files changed, 22 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/proxy_variables.t Mon Nov 19 19:28:15 2018 +0300 +++ b/proxy_variables.t Wed Nov 21 13:37:01 2018 +0300 @@ -22,7 +22,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(18) +my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(19) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -99,15 +99,33 @@ cmp_ok($ct, '<', 1, 'connect time - slow response body'); cmp_ok($ht, '<', 1, 'header time - slow response body'); -($ct, $ct2, $ht, $ht2, $rt) = get('/pnu', many => 1); +# expect no header time in 1st (bad) upstream, no (yet) response time in 2nd + +$re = qr/(\d\.\d{3}|-)/; +($ct, $ct2, $ht, $ht2, $rt, $rt2) = get('/pnu', many => 1); cmp_ok($ct, '<', 1, 'connect time - next'); cmp_ok($ct2, '<', 1, 'connect time - next 2'); -cmp_ok($ht, '>=', 1, 'header time - next'); + +TODO: { +local $TODO = 'not yet'; + +is($ht, '-', 'header time - next'); + +} + cmp_ok($ht2, '<', 1, 'header time - next 2'); -is($ht, $rt, 'header time - bad response'); +cmp_ok($rt, '>=', 1, 'response time - next'); + +TODO: { +local $TODO = 'not yet'; + +is($rt2, '-', 'response time - next 2'); + +} $t->stop(); +$re = qr/(\d\.\d{3})/; ($ct, $ht, $rt, $ct2, $ht2, $rt2) = $t->read_file('time.log') =~ /^$re:$re:$re\n$re:$re:$re$/;