[njs] Tests: tuned periodic test for delays.
noreply at nginx.com
noreply at nginx.com
Fri Jun 13 19:58:02 UTC 2025
details: https://github.com/nginx/njs/commit/3a22f42628e57f711bfc328e10388b2345f58647
branches: master
commit: 3a22f42628e57f711bfc328e10388b2345f58647
user: Dmitry Volyntsev <xeioex at nginx.com>
date: Thu, 12 Jun 2025 17:54:43 -0700
description:
Tests: tuned periodic test for delays.
---
nginx/t/js_periodic.t | 2 +-
nginx/t/js_periodic_fetch.t | 9 ++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/nginx/t/js_periodic.t b/nginx/t/js_periodic.t
index d6868935..7e134588 100644
--- a/nginx/t/js_periodic.t
+++ b/nginx/t/js_periodic.t
@@ -56,7 +56,7 @@ http {
server_name localhost;
location @periodic {
- js_periodic test.tick interval=30ms jitter=1ms;
+ js_periodic test.tick interval=20ms jitter=1ms;
js_periodic test.timer interval=1s worker_affinity=all;
js_periodic test.overrun interval=30ms;
js_periodic test.affinity interval=50ms worker_affinity=0101;
diff --git a/nginx/t/js_periodic_fetch.t b/nginx/t/js_periodic_fetch.t
index a323afb8..39385132 100644
--- a/nginx/t/js_periodic_fetch.t
+++ b/nginx/t/js_periodic_fetch.t
@@ -99,12 +99,11 @@ $t->write_file('test.js', <<EOF);
}
function test_fetch(r) {
- r.return(200, ngx.shared.strings.get('fetch').startsWith('okok'));
+ r.return(200, ngx.shared.strings.get('fetch'));
}
function test_multiple_fetches(r) {
- r.return(200, ngx.shared.strings.get('multiple_fetches')
- .startsWith('ok\@foo'));
+ r.return(200, ngx.shared.strings.get('multiple_fetches'));
}
export default { fetch, fetch_exception, multiple_fetches, test_fetch,
@@ -119,8 +118,8 @@ $t->plan(3);
select undef, undef, undef, 0.1;
-like(http_get('/test_fetch'), qr/true/, 'periodic fetch test');
-like(http_get('/test_multiple_fetches'), qr/true/, 'multiple fetch test');
+like(http_get('/test_fetch'), qr/(ok)+/, 'periodic fetch test');
+like(http_get('/test_multiple_fetches'), qr/ok\@foo/, 'multiple fetch test');
$t->stop();
More information about the nginx-devel
mailing list