[PATCH] Tests: adjusted proxy_cache_use_stale.t times
Maxim Dounin
mdounin at mdounin.ru
Mon Jul 21 21:31:45 UTC 2025
# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1753124770 -10800
# Mon Jul 21 22:06:10 2025 +0300
# Node ID 0b65f4c779066132ebb782923c8f3b3a0c03904a
# Parent d28c6b8eb29137664e5e949aeef01863082462ce
Tests: adjusted proxy_cache_use_stale.t times.
Previously, "stale-while-revalidate=10" was used in tests where stale
response should be usable till the end of the test. This is, however,
might be not enough on slow hosts, leading to occasional failures.
Fix is to use "stale-while-revalidate=20" instead.
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
@@ -132,7 +132,7 @@ http {
}
location /t9.html {
- add_header Cache-Control "max-age=1, stale-while-revalidate=10";
+ add_header Cache-Control "max-age=1, stale-while-revalidate=20";
}
}
}
@@ -157,23 +157,23 @@ EOF
like(get('/t.html', 'max-age=1, stale-if-error=5'), qr/MISS/, 'stale-if-error');
like(http_get('/t.html?e=1'), qr/HIT/, 's-i-e - cached');
-like(get('/t2.html', 'max-age=1, stale-while-revalidate=10'), qr/MISS/,
+like(get('/t2.html', 'max-age=1, stale-while-revalidate=20'), qr/MISS/,
'stale-while-revalidate');
like(http_get('/t2.html'), qr/HIT/, 's-w-r - cached');
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=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');
+get('/t4.html', 'max-age=1, stale-while-revalidate=20');
+get('/t5.html', 'max-age=1, stale-while-revalidate=20');
+get('/t6.html', 'max-age=1, stale-while-revalidate=20');
+get('/t7.html', 'max-age=1, stale-while-revalidate=20');
http_get('/ssi.html');
get('/updating/t.html', 'max-age=1');
get('/updating/t2.html', 'max-age=1, stale-while-revalidate=2');
get('/updating/tt.html', 'max-age=1, stale-if-error=5');
-get('/t8.html', 'stale-while-revalidate=10');
-get('/escape.htm%6C', 'max-age=1, stale-while-revalidate=10');
-get('/regexp.html', 'max-age=1, stale-while-revalidate=10');
+get('/t8.html', 'stale-while-revalidate=20');
+get('/escape.htm%6C', 'max-age=1, stale-while-revalidate=20');
+get('/regexp.html', 'max-age=1, stale-while-revalidate=20');
sleep 2;
More information about the nginx-devel
mailing list