Skip to content

Commit 2a47765

Browse files
committed
Tests: tuned periodic test for delays.
1 parent 032f5c8 commit 2a47765

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

nginx/t/js_periodic.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ http {
5656
server_name localhost;
5757
5858
location @periodic {
59-
js_periodic test.tick interval=30ms jitter=1ms;
59+
js_periodic test.tick interval=20ms jitter=1ms;
6060
js_periodic test.timer interval=1s worker_affinity=all;
6161
js_periodic test.overrun interval=30ms;
6262
js_periodic test.affinity interval=50ms worker_affinity=0101;

nginx/t/js_periodic_fetch.t

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ http {
4848
server_name localhost;
4949
5050
location @periodic {
51-
js_periodic test.fetch interval=40ms;
51+
js_periodic test.fetch interval=30ms;
5252
js_periodic test.multiple_fetches interval=1s;
5353
5454
js_periodic test.fetch_exception interval=1s;
@@ -99,12 +99,11 @@ $t->write_file('test.js', <<EOF);
9999
}
100100
101101
function test_fetch(r) {
102-
r.return(200, ngx.shared.strings.get('fetch').startsWith('okok'));
102+
r.return(200, ngx.shared.strings.get('fetch'));
103103
}
104104
105105
function test_multiple_fetches(r) {
106-
r.return(200, ngx.shared.strings.get('multiple_fetches')
107-
.startsWith('ok\@foo'));
106+
r.return(200, ngx.shared.strings.get('multiple_fetches'));
108107
}
109108
110109
export default { fetch, fetch_exception, multiple_fetches, test_fetch,
@@ -119,8 +118,8 @@ $t->plan(3);
119118

120119
select undef, undef, undef, 0.1;
121120

122-
like(http_get('/test_fetch'), qr/true/, 'periodic fetch test');
123-
like(http_get('/test_multiple_fetches'), qr/true/, 'multiple fetch test');
121+
like(http_get('/test_fetch'), qr/(ok)+/, 'periodic fetch test');
122+
like(http_get('/test_multiple_fetches'), qr/ok\@foo/, 'multiple fetch test');
124123

125124
$t->stop();
126125

0 commit comments

Comments
 (0)