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
120119select 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