From: Dmitry Volyntsev Date: Tue, 2 Apr 2024 06:13:24 +0000 (-0700) Subject: Tests: adapt stream_js_preload_object.t to nginx changes. X-Git-Tag: 0.8.4~9 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=4bf96d9d12348da689cdd0a85e668ad4ce16679a;p=njs.git Tests: adapt stream_js_preload_object.t to nginx changes. Make the test more robust against changes in nginx, specifically cf890df37bb6 (Stream: socket peek in preread phase). The filter callbacks may be called multiple times by nginx and the exact number is not specified. The new test avoids relying on the exact number of calls from nginx. --- diff --git a/nginx/t/stream_js_preload_object.t b/nginx/t/stream_js_preload_object.t index c28c401a..3c27098d 100644 --- a/nginx/t/stream_js_preload_object.t +++ b/nginx/t/stream_js_preload_object.t @@ -66,16 +66,17 @@ EOF $t->write_file('lib.js', <= 3) { + pup = g1.b[1]; + if (data.length > 0) { s.done(); } }); @@ -83,18 +84,16 @@ $t->write_file('lib.js', <try_run('no js_preload_object available')->plan(2); ############################################################################### is(stream('127.0.0.1:' . port(8081))->read(), 'element', 'foo.bar.p'); -is(stream('127.0.0.1:' . port(8082))->io('0'), 'x122345', 'lib.access'); +is(stream('127.0.0.1:' . port(8082))->io('0'), 'x1234', 'filter chain'); ###############################################################################