Mercurial > hg > nginx-tests
comparison proxy_cache_revalidate.t @ 354:fb366c51eac6
Tests: reduce race in cache revalidate test.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 18 Nov 2013 21:37:19 +0400 |
parents | 19f58e91617a |
children | c28ecaef065f |
comparison
equal
deleted
inserted
replaced
353:19f58e91617a | 354:fb366c51eac6 |
---|---|
91 | 91 |
92 # 1st document isn't modified, and should be revalidated on first request | 92 # 1st document isn't modified, and should be revalidated on first request |
93 # (a 304 status code will appear in backend's logs), then cached again | 93 # (a 304 status code will appear in backend's logs), then cached again |
94 | 94 |
95 like(http_get('/t'), qr/X-Cache-Status: REVALIDATED.*SEE/ms, 'revalidated'); | 95 like(http_get('/t'), qr/X-Cache-Status: REVALIDATED.*SEE/ms, 'revalidated'); |
96 like(http_get('/t'), qr/X-Cache-Status: HIT.*SEE/ms, 'request cached'); | |
97 | |
98 select undef, undef, undef, 0.1; | |
96 like(read_file($t->testdir() . '/access.log'), qr/ 304 /, 'not modified'); | 99 like(read_file($t->testdir() . '/access.log'), qr/ 304 /, 'not modified'); |
97 like(http_get('/t'), qr/X-Cache-Status: HIT.*SEE/ms, 'request cached'); | |
98 | 100 |
99 # 2nd document is recreated with a new content | 101 # 2nd document is recreated with a new content |
100 | 102 |
101 $t->write_file('t2', 'NEW'); | 103 $t->write_file('t2', 'NEW'); |
102 like(http_get('/t2'), qr/X-Cache-Status: EXPIRED.*NEW/ms, 'revalidate failed'); | 104 like(http_get('/t2'), qr/X-Cache-Status: EXPIRED.*NEW/ms, 'revalidate failed'); |