[PATCH 5 of 5] Tests: adjusted proxy_cache_use_stale.t cache validity

Maxim Dounin mdounin at mdounin.ru
Fri Aug 9 20:37:29 UTC 2024


# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1723217845 -10800
#      Fri Aug 09 18:37:25 2024 +0300
# Node ID 15f538440a7734a57353054f2f2e33808f8a1174
# Parent  6b3b31149551efb88fa863901563932c19679db2
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.

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