[nginx-tests] Tests: adjusted proxy_cache_use_stale.t cache vali...

Maxim Dounin mdounin at mdounin.ru
Mon Aug 12 03:37:28 UTC 2024


details:   http://freenginx.org/hg/nginx-tests/rev/15f538440a77
branches:  
changeset: 1999:15f538440a77
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Fri Aug 09 18:37:25 2024 +0300
description:
Tests: adjusted proxy_cache_use_stale.t cache validity.

At least the "s-w-r - updating stale" test sometimes fails on slow
hosts due to "stale-while-revalidate=4" being not enough, so the request
returns with the EXPIRED cache status instead of STALE.

Fix is to use larger "stale-while-revalidate=" times where it is not
significant.

diffstat:

 proxy_cache_use_stale.t |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (16 lines):

diff --git a/proxy_cache_use_stale.t b/proxy_cache_use_stale.t
--- a/proxy_cache_use_stale.t
+++ b/proxy_cache_use_stale.t
@@ -163,9 +163,9 @@ like(http_get('/t2.html'), qr/HIT/, 's-w
 
 get('/tt.html', 'max-age=1, stale-if-error=3');
 get('/t3.html', 'max-age=1, stale-while-revalidate=2');
-get('/t4.html', 'max-age=1, stale-while-revalidate=3');
-get('/t5.html', 'max-age=1, stale-while-revalidate=3');
-get('/t6.html', 'max-age=1, stale-while-revalidate=4');
+get('/t4.html', 'max-age=1, stale-while-revalidate=10');
+get('/t5.html', 'max-age=1, stale-while-revalidate=10');
+get('/t6.html', 'max-age=1, stale-while-revalidate=10');
 get('/t7.html', 'max-age=1, stale-while-revalidate=10');
 http_get('/ssi.html');
 get('/updating/t.html', 'max-age=1');


More information about the nginx-devel mailing list