comparison proxy_cache_lock_age.t @ 576:239ade56c015

Tests: more proxy_cache_lock_age tests. Reflect that when an aged request completes, the response updates proxy cache.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 14 May 2015 17:28:52 +0300
parents 2cd00179f4b2
children e9064d691790
comparison
equal deleted inserted replaced
575:eea2b0158b51 576:239ade56c015
15 use IO::Select; 15 use IO::Select;
16 16
17 BEGIN { use FindBin; chdir($FindBin::Bin); } 17 BEGIN { use FindBin; chdir($FindBin::Bin); }
18 18
19 use lib 'lib'; 19 use lib 'lib';
20 use Test::Nginx; 20 use Test::Nginx qw/ :DEFAULT http_end /;
21 21
22 ############################################################################### 22 ###############################################################################
23 23
24 select STDERR; $| = 1; 24 select STDERR; $| = 1;
25 select STDOUT; $| = 1; 25 select STDOUT; $| = 1;
26 26
27 my $t = Test::Nginx->new()->has(qw/http proxy cache shmem/)->plan(2) 27 my $t = Test::Nginx->new()->has(qw/http proxy cache shmem/)->plan(4)
28 ->write_file_expand('nginx.conf', <<'EOF'); 28 ->write_file_expand('nginx.conf', <<'EOF');
29 29
30 %%TEST_GLOBALS%% 30 %%TEST_GLOBALS%%
31 31
32 daemon off; 32 daemon off;
65 65
66 like(http_get('/'), qr/request 2/, 'request'); 66 like(http_get('/'), qr/request 2/, 'request');
67 like(http_get('/'), qr/request 2/, 'request cached'); 67 like(http_get('/'), qr/request 2/, 'request cached');
68 68
69 http_get('/close'); 69 http_get('/close');
70
71 like(http_end($s), qr/request 1/, 'request aged');
72 like(http_get('/'), qr/request 1/, 'request aged cached');
70 73
71 ############################################################################### 74 ###############################################################################
72 75
73 sub http_daemon { 76 sub http_daemon {
74 my (@ports) = @_; 77 my (@ports) = @_;