comparison proxy_cache.t @ 713:94033cdc2f78

Tests: adjusted proxy_cache.t timeout to get stale cached response. Assert this is actually so by testing $upstream_cache_status value.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 24 Sep 2015 23:34:11 +0300
parents 6c0a5903d0ae
children d1da28e28d1d
comparison
equal deleted inserted replaced
712:649af6069976 713:94033cdc2f78
97 'cached multipart range'); 97 'cached multipart range');
98 98
99 like(http_get('/empty.html'), qr/MISS/, 'empty get first'); 99 like(http_get('/empty.html'), qr/MISS/, 'empty get first');
100 like(http_get('/empty.html'), qr/HIT/, 'empty get second'); 100 like(http_get('/empty.html'), qr/HIT/, 'empty get second');
101 101
102 select(undef, undef, undef, 1.1); 102 select(undef, undef, undef, 2.1);
103 unlink $t->testdir() . '/t.html'; 103 unlink $t->testdir() . '/t.html';
104 like(http_gzip_request('/t.html'), 104 like(http_gzip_request('/t.html'),
105 qr/HTTP.*1c\x0d\x0a.{28}\x0d\x0a0\x0d\x0a\x0d\x0a\z/s, 105 qr/HTTP.*STALE.*1c\x0d\x0a.{28}\x0d\x0a0\x0d\x0a\x0d\x0a\z/s,
106 'non-empty get stale'); 106 'non-empty get stale');
107 107
108 unlink $t->testdir() . '/empty.html'; 108 unlink $t->testdir() . '/empty.html';
109 like(http_gzip_request('/empty.html'), 109 like(http_gzip_request('/empty.html'),
110 qr/HTTP.*14\x0d\x0a.{20}\x0d\x0a0\x0d\x0a\x0d\x0a\z/s, 110 qr/HTTP.*STALE.*14\x0d\x0a.{20}\x0d\x0a0\x0d\x0a\x0d\x0a\z/s,
111 'empty get stale'); 111 'empty get stale');
112 112
113 ############################################################################### 113 ###############################################################################
114 114
115 sub http_get_range { 115 sub http_get_range {