diff --git a/t/023-rewrite/uthread-exit.t b/t/023-rewrite/uthread-exit.t index 87f850ce8b..ec0ce4534f 100644 --- a/t/023-rewrite/uthread-exit.t +++ b/t/023-rewrite/uthread-exit.t @@ -8,7 +8,7 @@ our $StapScript = $t::StapThread::StapScript; repeat_each(2); -plan tests => repeat_each() * (blocks() * 4 + 1); +plan tests => repeat_each() * (blocks() * 4); $ENV{TEST_NGINX_RESOLVER} ||= '8.8.8.8'; $ENV{TEST_NGINX_MEMCACHED_PORT} ||= '11211'; @@ -299,7 +299,7 @@ exiting the user thread --- config location /lua { resolver 127.0.0.2:12345; - resolver_timeout 12s; + resolver_timeout 2s; rewrite_by_lua ' local function f() ngx.say("hello in thread") @@ -321,82 +321,13 @@ exiting the user thread } --- request GET /lua ---- stap2 eval: $::StapScript ---- stap eval -<<'_EOC_' . $::GCScript; - -global timers - -F(ngx_resolve_start) { - println("resolver started") -} - -F(ngx_http_lua_socket_resolve_handler) { - println("resolver done") -} - -F(ngx_http_free_request) { - println("free request") -} - -F(ngx_resolve_name) { - printf("resolving %s\n", user_string_n($ctx->name->data, $ctx->name->len)) -} - -M(timer-add) { - if ($arg2 == 12000 || $arg2 == 1) { - timers[$arg1] = $arg2 - printf("add timer %d\n", $arg2) - } -} - -M(timer-del) { - tm = timers[$arg1] - if (tm == 12000 || tm == 1) { - printf("delete timer %d\n", tm) - delete timers[$arg1] - } - /* - if (tm == 12000) { - print_ubacktrace() - } - */ -} - -M(timer-expire) { - tm = timers[$arg1] - if (tm == 12000 || tm == 1) { - printf("expire timer %d\n", timers[$arg1]) - delete timers[$arg1] - } -} - -F(ngx_http_lua_tcp_resolve_cleanup) { - println("lua tcp resolve cleanup") -} -_EOC_ - ---- stap_out -create 2 in 1 -spawn user thread 2 in 1 -add timer 1 -resolver started -resolving agentzh.org -add timer 12000 -expire timer 1 -terminate 2: ok -delete thread 2 -lua tcp resolve cleanup -delete timer 12000 -delete thread 1 -free request - --- response_body before hello in thread after --- no_error_log [error] +[crit] @@ -405,8 +336,9 @@ after location /lua { resolver 127.0.0.2:12345; #resolver 127.0.0.1; - resolver_timeout 12s; + resolver_timeout 2s; rewrite_by_lua ' + collectgarbage("collect") local function f() ngx.say("hello in thread") ngx.sleep(0.001) @@ -427,76 +359,6 @@ after } --- request GET /lua ---- stap2 eval: $::StapScript ---- stap eval -<<'_EOC_' . $::GCScript; - -global timers - -F(ngx_resolve_start) { - println("resolver started") -} - -F(ngx_http_lua_socket_resolve_handler) { - println("resolver done") -} - -F(ngx_http_free_request) { - println("free request") -} - -F(ngx_resolve_name) { - printf("resolving %s\n", user_string_n($ctx->name->data, $ctx->name->len)) -} - -M(timer-add) { - if ($arg2 == 12000 || $arg2 == 1) { - timers[$arg1] = $arg2 - printf("add timer %d\n", $arg2) - } -} - -M(timer-del) { - tm = timers[$arg1] - if (tm == 12000 || tm == 1) { - printf("delete timer %d\n", tm) - delete timers[$arg1] - } - /* - if (tm == 12000) { - print_ubacktrace() - } - */ -} - -M(timer-expire) { - tm = timers[$arg1] - if (tm == 12000 || tm == 1) { - printf("expire timer %d\n", timers[$arg1]) - delete timers[$arg1] - } -} - -F(ngx_http_lua_udp_resolve_cleanup) { - println("lua udp resolve cleanup") -} -_EOC_ - ---- stap_out -create 2 in 1 -spawn user thread 2 in 1 -add timer 1 -resolver started -resolving agentzh.org -add timer 12000 -expire timer 1 -terminate 2: ok -delete thread 2 -lua udp resolve cleanup -delete timer 12000 -delete thread 1 -free request - --- response_body before hello in thread @@ -994,7 +856,7 @@ after === TEST 12: exit in user thread (entry thread is still pending on ngx.req.read_body) --- config location /lua { - client_body_timeout 12000ms; + client_body_timeout 2000ms; rewrite_by_lua ' local function f() ngx.say("hello in thread") @@ -1080,7 +942,7 @@ after === TEST 13: exit in user thread (entry thread is still pending on ngx.location.capture), with pending output --- config location /lua { - client_body_timeout 12000ms; + client_body_timeout 2000ms; rewrite_by_lua ' local function f() ngx.say("hello in thread") @@ -1164,7 +1026,7 @@ attempt to abort with pending subrequests === TEST 14: exit in user thread (entry thread is still pending on ngx.location.capture), without pending output --- config location /lua { - client_body_timeout 12000ms; + client_body_timeout 2000ms; rewrite_by_lua ' local function f() ngx.sleep(0.1) @@ -1247,7 +1109,7 @@ attempt to abort with pending subrequests === TEST 15: exit in user thread (entry thread is still pending on ngx.location.capture_multi), without pending output --- config location /lua { - client_body_timeout 12000ms; + client_body_timeout 2000ms; rewrite_by_lua ' local function f() ngx.sleep(0.1) diff --git a/t/024-access/uthread-exit.t b/t/024-access/uthread-exit.t index bd165ae708..0ee5fbab82 100644 --- a/t/024-access/uthread-exit.t +++ b/t/024-access/uthread-exit.t @@ -299,7 +299,7 @@ exiting the user thread --- config location /lua { resolver 127.0.0.2:12345; - resolver_timeout 12s; + resolver_timeout 2s; access_by_lua ' local function f() ngx.say("hello in thread") @@ -321,73 +321,13 @@ exiting the user thread } --- request GET /lua ---- stap2 eval: $::StapScript ---- stap eval -<<'_EOC_' . $::GCScript; - -global timers - -F(ngx_http_free_request) { - println("free request") -} - -F(ngx_resolve_name) { - printf("resolving %s\n", user_string_n($ctx->name->data, $ctx->name->len)) -} - -M(timer-add) { - if ($arg2 == 12000 || $arg2 == 1) { - timers[$arg1] = $arg2 - printf("add timer %d\n", $arg2) - } -} - -M(timer-del) { - tm = timers[$arg1] - if (tm == 12000 || tm == 1) { - printf("delete timer %d\n", tm) - delete timers[$arg1] - } - /* - if (tm == 12000) { - print_ubacktrace() - } - */ -} - -M(timer-expire) { - tm = timers[$arg1] - if (tm == 12000 || tm == 1) { - printf("expire timer %d\n", timers[$arg1]) - delete timers[$arg1] - } -} - -F(ngx_http_lua_tcp_resolve_cleanup) { - println("lua tcp resolve cleanup") -} -_EOC_ - ---- stap_out -create 2 in 1 -spawn user thread 2 in 1 -add timer 1 -resolving agentzh.org -add timer 12000 -expire timer 1 -terminate 2: ok -delete thread 2 -lua tcp resolve cleanup -delete timer 12000 -delete thread 1 -free request - --- response_body before hello in thread after --- no_error_log [error] +[crit] @@ -395,7 +335,7 @@ after --- config location /lua { resolver 127.0.0.2:12345; - resolver_timeout 12s; + resolver_timeout 2s; access_by_lua ' local function f() ngx.say("hello in thread") @@ -417,73 +357,13 @@ after } --- request GET /lua ---- stap2 eval: $::StapScript ---- stap eval -<<'_EOC_' . $::GCScript; - -global timers - -F(ngx_http_free_request) { - println("free request") -} - -F(ngx_resolve_name) { - printf("resolving %s\n", user_string_n($ctx->name->data, $ctx->name->len)) -} - -M(timer-add) { - if ($arg2 == 12000 || $arg2 == 1) { - timers[$arg1] = $arg2 - printf("add timer %d\n", $arg2) - } -} - -M(timer-del) { - tm = timers[$arg1] - if (tm == 12000 || tm == 1) { - printf("delete timer %d\n", tm) - delete timers[$arg1] - } - /* - if (tm == 12000) { - print_ubacktrace() - } - */ -} - -M(timer-expire) { - tm = timers[$arg1] - if (tm == 12000 || tm == 1) { - printf("expire timer %d\n", timers[$arg1]) - delete timers[$arg1] - } -} - -F(ngx_http_lua_udp_resolve_cleanup) { - println("lua udp resolve cleanup") -} -_EOC_ - ---- stap_out -create 2 in 1 -spawn user thread 2 in 1 -add timer 1 -resolving agentzh.org -add timer 12000 -expire timer 1 -terminate 2: ok -delete thread 2 -lua udp resolve cleanup -delete timer 12000 -delete thread 1 -free request - --- response_body before hello in thread after --- no_error_log [error] +[crit] @@ -977,7 +857,7 @@ after --- skip_eval: 3:$ENV{TEST_NGINX_USE_HTTP3} --- config location /lua { - client_body_timeout 12000ms; + client_body_timeout 2000ms; access_by_lua ' local function f() ngx.say("hello in thread") @@ -998,57 +878,6 @@ after POST /lua --- more_headers Content-Length: 1024 ---- stap2 eval: $::StapScript ---- stap eval -<<'_EOC_' . $::GCScript; - -global timers - -F(ngx_http_free_request) { - println("free request") -} - -M(timer-add) { - if ($arg2 == 12000 || $arg2 == 100) { - timers[$arg1] = $arg2 - printf("add timer %d\n", $arg2) - } -} - -M(timer-del) { - tm = timers[$arg1] - if (tm == 12000 || tm == 100) { - printf("delete timer %d\n", tm) - delete timers[$arg1] - } -} - -M(timer-expire) { - tm = timers[$arg1] - if (tm == 12000 || tm == 100) { - printf("expire timer %d\n", timers[$arg1]) - delete timers[$arg1] - } -} - -F(ngx_http_lua_req_body_cleanup) { - println("lua req body cleanup") -} -_EOC_ - ---- stap_out -create 2 in 1 -spawn user thread 2 in 1 -add timer 100 -add timer 12000 -expire timer 100 -terminate 2: ok -delete thread 2 -lua req body cleanup -delete timer 12000 -delete thread 1 -free request - --- wait: 0.1 --- response_body before @@ -1056,13 +885,14 @@ hello in thread after --- no_error_log [error] +[crit] === TEST 13: exit in user thread (entry thread is still pending on ngx.location.capture), with pending output --- config location /lua { - client_body_timeout 12000ms; + client_body_timeout 2000ms; access_by_lua ' local function f() ngx.say("hello in thread") @@ -1085,53 +915,6 @@ after } --- request POST /lua ---- stap2 eval: $::StapScript ---- stap eval -<<'_EOC_' . $::GCScript; - -global timers - -F(ngx_http_free_request) { - println("free request") -} - -M(timer-add) { - if ($arg2 == 200 || $arg2 == 100) { - timers[$arg1] = $arg2 - printf("add timer %d\n", $arg2) - } -} - -M(timer-del) { - tm = timers[$arg1] - if (tm == 200 || tm == 100) { - printf("delete timer %d\n", tm) - delete timers[$arg1] - } -} - -M(timer-expire) { - tm = timers[$arg1] - if (tm == 200 || tm == 100) { - printf("expire timer %d\n", timers[$arg1]) - delete timers[$arg1] - } -} -_EOC_ - ---- stap_out -create 2 in 1 -spawn user thread 2 in 1 -add timer 100 -add timer 200 -expire timer 100 -terminate 2: fail -expire timer 200 -terminate 1: ok -delete thread 2 -delete thread 1 -free request - --- wait: 0.1 --- response_body before @@ -1140,13 +923,15 @@ after end --- error_log attempt to abort with pending subrequests +--- no_error_log +[crit] === TEST 14: exit in user thread (entry thread is still pending on ngx.location.capture), without pending output --- config location /lua { - client_body_timeout 12000ms; + client_body_timeout 2000ms; access_by_lua ' local function f() ngx.sleep(0.1) @@ -1165,71 +950,20 @@ attempt to abort with pending subrequests } --- request POST /lua ---- stap2 eval: $::StapScript ---- stap eval -<<'_EOC_' . $::GCScript; - -global timers - -F(ngx_http_free_request) { - println("free request") -} - -M(timer-add) { - if ($arg2 == 200 || $arg2 == 100) { - timers[$arg1] = $arg2 - printf("add timer %d\n", $arg2) - } -} - -M(timer-del) { - tm = timers[$arg1] - if (tm == 200 || tm == 100) { - printf("delete timer %d\n", tm) - delete timers[$arg1] - } -} - -M(timer-expire) { - tm = timers[$arg1] - if (tm == 200 || tm == 100) { - printf("expire timer %d\n", timers[$arg1]) - delete timers[$arg1] - } -} - -F(ngx_http_lua_post_subrequest) { - printf("post subreq %s\n", ngx_http_req_uri($r)) -} - -_EOC_ - ---- stap_out -create 2 in 1 -spawn user thread 2 in 1 -add timer 100 -add timer 200 -expire timer 100 -terminate 2: fail -expire timer 200 -post subreq /sleep -terminate 1: ok -delete thread 2 -delete thread 1 -free request - --- wait: 0.1 --- response_body end --- error_log attempt to abort with pending subrequests +--- no_error_log +[crit] === TEST 15: exit in user thread (entry thread is still pending on ngx.location.capture_multi), without pending output --- config location /lua { - client_body_timeout 12000ms; + client_body_timeout 2000ms; access_by_lua ' local function f() ngx.sleep(0.1) @@ -1255,61 +989,10 @@ attempt to abort with pending subrequests } --- request POST /lua ---- stap2 eval: $::StapScript ---- stap eval -<<'_EOC_' . $::GCScript; - -global timers - -F(ngx_http_free_request) { - println("free request") -} - -M(timer-add) { - if ($arg2 == 200 || $arg2 == 100) { - timers[$arg1] = $arg2 - printf("add timer %d\n", $arg2) - } -} - -M(timer-del) { - tm = timers[$arg1] - if (tm == 200 || tm == 100) { - printf("delete timer %d\n", tm) - delete timers[$arg1] - } -} - -M(timer-expire) { - tm = timers[$arg1] - if (tm == 200 || tm == 100) { - printf("expire timer %d\n", timers[$arg1]) - delete timers[$arg1] - } -} - -F(ngx_http_lua_post_subrequest) { - printf("post subreq %s\n", ngx_http_req_uri($r)) -} -_EOC_ - ---- stap_out -create 2 in 1 -spawn user thread 2 in 1 -add timer 100 -post subreq /echo -add timer 200 -expire timer 100 -terminate 2: fail -expire timer 200 -post subreq /sleep -terminate 1: ok -delete thread 2 -delete thread 1 -free request - --- wait: 0.1 --- response_body end --- error_log attempt to abort with pending subrequests +--- no_error_log +[crit] diff --git a/t/039-sub-o.t b/t/039-sub-o.t index 580a67161e..5cdba6b5ee 100644 --- a/t/039-sub-o.t +++ b/t/039-sub-o.t @@ -8,7 +8,7 @@ use Test::Nginx::Socket::Lua; repeat_each(2); -plan tests => repeat_each() * (blocks() * 2 + 6); +plan 'no_plan'; #no_diff(); no_long_string(); @@ -54,6 +54,7 @@ hello, world --- config location /re { content_by_lua ' + collectgarbage("collect") -- memory leak test local s, n = ngx.re.sub("a b c d", "(b) (c)", "[$0] [$1] [$2] [$3] [$134]", "o") ngx.say(s) ngx.say(n) @@ -71,6 +72,7 @@ a [b c] [b] [c] [] [] d --- config location /re { content_by_lua ' + collectgarbage("collect") -- memory leak test local s, n, err = ngx.re.sub("a b c d", "(b) (c)", "[$0] [$1] [$2] [$3] [$hello]", @@ -96,6 +98,7 @@ attempt to use named capturing variable "hello" (named captures not supported ye --- config location /re { content_by_lua ' + collectgarbage("collect") -- memory leak test local s, n, err = ngx.re.sub("a b c d", "(b) (c)", "[$0] [$1] [$2] [$3] [${hello}]", @@ -120,6 +123,7 @@ attempt to use named capturing variable "hello" (named captures not supported ye --- config location /re { content_by_lua ' + collectgarbage("collect") -- memory leak test local s, n = ngx.re.sub("b c d", "(b) (c)", "[$0] [$1] [${2}] [$3] [${134}]", "o") ngx.say(s) ngx.say(n) @@ -137,6 +141,7 @@ attempt to use named capturing variable "hello" (named captures not supported ye --- config location /re { content_by_lua ' + collectgarbage("collect") -- memory leak test local s, n, err = ngx.re.sub("b c d", "(b) (c)", "[$0] [$1] [${2}] [$3] [${134]", "o") if s then ngx.say(s, ": ", n) @@ -158,6 +163,7 @@ the closing bracket in "134" variable is missing --- config location /re { content_by_lua ' + collectgarbage("collect") -- memory leak test local s, n, err = ngx.re.sub("b c d", "(b) (c)", "[$0] [$1] [${2}] [$3] [${134", "o") if s then ngx.say(s, ": ", n) @@ -179,6 +185,7 @@ the closing bracket in "134" variable is missing --- config location /re { content_by_lua ' + collectgarbage("collect") -- memory leak test local s, n, err = ngx.re.sub("b c d", "(b) (c)", "[$0] [$1] [${2}] [$3] [${", "o") if s then ngx.say(s, ": ", n) @@ -200,6 +207,7 @@ lua script: invalid capturing variable name found in "[$0] [$1] [${2}] [$3] [${" --- config location /re { content_by_lua ' + collectgarbage("collect") -- memory leak test local s, n, err = ngx.re.sub("b c d", "(b) (c)", "[$0] [$1] [${2}] [$3] [$", "o") if s then ngx.say(s, ": ", n) diff --git a/t/094-uthread-exit.t b/t/094-uthread-exit.t index 375d8d6023..62f4c5bbca 100644 --- a/t/094-uthread-exit.t +++ b/t/094-uthread-exit.t @@ -8,7 +8,7 @@ our $StapScript = $t::StapThread::StapScript; repeat_each(2); -plan tests => repeat_each() * (blocks() * 4 - 2); +plan 'no_plan'; $ENV{TEST_NGINX_RESOLVER} ||= '8.8.8.8'; $ENV{TEST_NGINX_MEMCACHED_PORT} ||= '11211'; @@ -298,7 +298,7 @@ exiting the user thread --- config location /lua { resolver 127.0.0.2:12345; - resolver_timeout 12s; + resolver_timeout 2s; content_by_lua ' local function f() ngx.say("hello in thread") @@ -394,7 +394,7 @@ after --- config location /lua { resolver 127.0.0.2:12345; - resolver_timeout 12s; + resolver_timeout 2s; content_by_lua ' local function f() ngx.say("hello in thread") @@ -973,7 +973,7 @@ after === TEST 12: exit in user thread (entry thread is still pending on ngx.req.read_body) --- config location /lua { - client_body_timeout 12000ms; + client_body_timeout 2000ms; content_by_lua ' local function f() ngx.say("hello in thread") @@ -1059,7 +1059,7 @@ after === TEST 13: exit(0) in user thread (entry thread is still pending on ngx.location.capture), with pending output --- config location /lua { - client_body_timeout 12000ms; + client_body_timeout 2000ms; content_by_lua ' local function f() ngx.say("hello in thread") @@ -1141,7 +1141,7 @@ attempt to abort with pending subrequests === TEST 14: exit in user thread (entry thread is still pending on ngx.location.capture), without pending output --- config location /lua { - client_body_timeout 12000ms; + client_body_timeout 2000ms; content_by_lua ' local function f() ngx.sleep(0.1) @@ -1224,7 +1224,7 @@ attempt to abort with pending subrequests === TEST 15: exit in user thread (entry thread is still pending on ngx.location.capture_multi), without pending output --- config location /lua { - client_body_timeout 12000ms; + client_body_timeout 2000ms; content_by_lua ' local function f() ngx.sleep(0.1) @@ -1315,7 +1315,7 @@ attempt to abort with pending subrequests --- no_http2 --- config location /lua { - client_body_timeout 12000ms; + client_body_timeout 2000ms; content_by_lua ' local function f() ngx.location.capture_multi{ @@ -1410,7 +1410,7 @@ qr#curl: \(52\) Empty reply from server|curl: \(95\) HTTP/3 stream 0 reset by se --- no_http2 --- config location /lua { - client_body_timeout 12000ms; + client_body_timeout 2000ms; content_by_lua ' local function f() ngx.say("hello in thread") @@ -1496,7 +1496,7 @@ qr#curl: \(52\) Empty reply from server|curl: \(95\) HTTP/3 stream 0 reset by se --- no_http2 --- config location /lua { - client_body_timeout 12000ms; + client_body_timeout 2000ms; content_by_lua ' local function f() ngx.say("hello in thread") @@ -1581,7 +1581,7 @@ qr#curl: \(52\) Empty reply from server|curl: \(95\) HTTP/3 stream 0 reset by se === TEST 19: exit(499) in user thread (entry thread is still pending on ngx.location.capture), with pending output --- config location /lua { - client_body_timeout 12000ms; + client_body_timeout 2000ms; content_by_lua ' local function f() ngx.say("hello in thread") diff --git a/t/120-re-find.t b/t/120-re-find.t index 43ccece1ab..70c64e9469 100644 --- a/t/120-re-find.t +++ b/t/120-re-find.t @@ -9,7 +9,7 @@ use Test::Nginx::Socket::Lua; repeat_each(2); -plan tests => repeat_each() * (blocks() * 3 + 1); +plan 'no_plan'; #no_diff(); no_long_string(); @@ -33,6 +33,7 @@ __DATA__ end ngx.say("not matched!") end + collectgarbage("collect") '; } --- request @@ -62,6 +63,7 @@ matched: 1234 end ngx.say("not matched!") end + collectgarbage("collect") '; } --- request @@ -88,6 +90,7 @@ matched: else ngx.say("not matched!") end + collectgarbage("collect") '; } --- request @@ -115,6 +118,7 @@ matched: hello, 1234 else ngx.say("not matched.") end + collectgarbage("collect") '; } --- request @@ -136,6 +140,7 @@ not matched. else ngx.say("not matched.") end + collectgarbage("collect") '; } --- request @@ -161,6 +166,7 @@ not matched. else ngx.say("not matched.") end + collectgarbage("collect") '; } --- request @@ -186,6 +192,7 @@ matched: hello end ngx.say(string.sub(s, from, to)) + collectgarbage("collect") '; } --- request @@ -211,6 +218,7 @@ matched: hello else ngx.say("not matched.") end + collectgarbage("collect") '; } --- request @@ -238,6 +246,7 @@ matched: world else ngx.say("not matched.") end + collectgarbage("collect") '; } --- request @@ -265,6 +274,7 @@ matched: hello else ngx.say("not matched.") end + collectgarbage("collect") '; } --- request @@ -290,6 +300,7 @@ not matched. else ngx.say("not matched.") end + collectgarbage("collect") '; } --- request @@ -318,6 +329,7 @@ world else ngx.say("not matched.") end + collectgarbage("collect") '; } --- request @@ -335,6 +347,7 @@ matched: he --- config location /re { content_by_lua ' + collectgarbage("collect") local s = "hello\\nworld" local from, to, err = ngx.re.find(s, "(abc") if from then @@ -383,6 +396,7 @@ $Test::Nginx::Util::PcreVersion == 2 ? ngx.say("not matched.") end + collectgarbage("collect") '; } --- request @@ -413,6 +427,7 @@ unknown flag "H" ngx.say("not matched.") end + collectgarbage("collect") '; } --- request @@ -443,6 +458,7 @@ not matched. ngx.say("not matched.") end + collectgarbage("collect") '; } --- request @@ -470,6 +486,7 @@ matched: 1234 ngx.say("not matched!") ngx.say("pos: ", ctx.pos) end + collectgarbage("collect") '; } --- request @@ -497,6 +514,7 @@ pos: 5 ngx.say("not matched!") ngx.say("pos: ", ctx.pos) end + collectgarbage("collect") '; } --- request @@ -529,6 +547,7 @@ pos: 5 ngx.say("not matched.") end + collectgarbage("collect") '; } --- request @@ -561,6 +580,7 @@ matched: hello, 1234 else ngx.say("not matched") end + collectgarbage("collect") '; } --- request @@ -590,6 +610,7 @@ $Test::Nginx::Util::PcreVersion == 2 ? else ngx.say("not matched.") end + collectgarbage("collect") '; } --- stap @@ -629,18 +650,13 @@ matched: 你 >>> a.lua local re = [==[(?i:([\s'\"`´’‘\(\)]*)?([\d\w]+)([\s'\"`´’‘\(\)]*)?(?:=|<=>|r?like|sounds\s+like|regexp)([\s'\"`´’‘\(\)]*)?\2|([\s'\"`´’‘\(\)]*)?([\d\w]+)([\s'\"`´’‘\(\)]*)?(?:!=|<=|>=|<>|<|>|\^|is\s+not|not\s+like|not\s+regexp)([\s'\"`´’‘\(\)]*)?(?!\6)([\d\w]+))]==] +collectgarbage("collect") local s = string.rep([[ABCDEFG]], 10) local start = ngx.now() local from, to, err = ngx.re.find(s, re, "o") ---[[ -ngx.update_time() -local elapsed = ngx.now() - start -ngx.say(elapsed, " sec elapsed.") -]] - if not from then if err then ngx.say("error: ", err) @@ -677,18 +693,13 @@ $Test::Nginx::Util::PcreVersion == 2 ? >>> a.lua local re = [==[(?i:([\s'\"`´’‘\(\)]*)?([\d\w]+)([\s'\"`´’‘\(\)]*)?(?:=|<=>|r?like|sounds\s+like|regexp)([\s'\"`´’‘\(\)]*)?\2|([\s'\"`´’‘\(\)]*)?([\d\w]+)([\s'\"`´’‘\(\)]*)?(?:!=|<=|>=|<>|<|>|\^|is\s+not|not\s+like|not\s+regexp)([\s'\"`´’‘\(\)]*)?(?!\6)([\d\w]+))]==] +collectgarbage("collect") local s = string.rep([[ABCDEFG]], 10) local start = ngx.now() local from, to, err = ngx.re.find(s, re, "o") ---[[ -ngx.update_time() -local elapsed = ngx.now() - start -ngx.say(elapsed, " sec elapsed.") -]] - if not from then if err then ngx.say("error: ", err) @@ -712,6 +723,7 @@ failed to match location /re { content_by_lua ' local s = "hello, 1234" + collectgarbage("collect") local from, to, err = ngx.re.find(s, "([0-9])([0-9]+)", "jo", nil, 1) if from then ngx.say("from: ", from) @@ -740,6 +752,7 @@ matched: 1 --- config location /re { content_by_lua ' + collectgarbage("collect") local s = "hello, 1234" local from, to, err = ngx.re.find(s, "([0-9])([0-9]+)", "jo", nil, 0) if from then @@ -769,6 +782,7 @@ matched: 1234 --- config location /re { content_by_lua ' + collectgarbage("collect") local s = "hello, 1234" local from, to, err = ngx.re.find(s, "([0-9])([0-9]+)", "jo", nil, 2) if from then @@ -798,6 +812,7 @@ matched: 234 --- config location /re { content_by_lua ' + collectgarbage("collect") local s = "hello, 1234" local from, to, err = ngx.re.find(s, "([0-9])([0-9]+)", "jo", nil, 3) if from then @@ -826,6 +841,7 @@ error: nth out of bound --- config location /re { content_by_lua ' + collectgarbage("collect") local s = "hello, 1234" local from, to, err = ngx.re.find(s, "([0-9])([0-9]+)", "jo", nil, 4) if from then @@ -854,6 +870,7 @@ error: nth out of bound --- config location /re { content_by_lua ' + collectgarbage("collect") local s = "hello, 1234" local from, to, err = ngx.re.find(s, "([0-9])|(hello world)", "jo", nil, 2) if from or to then @@ -882,6 +899,7 @@ not matched! --- config location /re { content_by_lua ' + collectgarbage("collect") local s = "hello, 1234" local from, to, err = ngx.re.find(s, "(hello world)|([0-9])", "jo", nil, 1) if from or to then @@ -910,6 +928,7 @@ not matched! --- config location /re { content_by_lua ' + collectgarbage("collect") local ctx = { pos = 3 } local from, to, err = ngx.re.find("1234, hello", [[(\G[0-9]+)]], "", ctx) if from then @@ -939,6 +958,7 @@ pos: 5 --- config location /re { content_by_lua_block { + collectgarbage("collect") local s = "This is no more" local from, to, err = ngx.re.find(s, "<.*>", "d") if from then diff --git a/t/127-uthread-kill.t b/t/127-uthread-kill.t index 77cf2bf9d3..c397d433b4 100644 --- a/t/127-uthread-kill.t +++ b/t/127-uthread-kill.t @@ -8,7 +8,7 @@ our $StapScript = $t::StapThread::StapScript; repeat_each(2); -plan tests => repeat_each() * (blocks() * 5 + 1) - 4; +plan 'no_plan'; $ENV{TEST_NGINX_RESOLVER} ||= '8.8.8.8'; $ENV{TEST_NGINX_MEMCACHED_PORT} ||= '11211'; diff --git a/t/138-balancer.t b/t/138-balancer.t index 0ef54f99e1..105743a679 100644 --- a/t/138-balancer.t +++ b/t/138-balancer.t @@ -583,6 +583,7 @@ upstream sent more data than specified in "Content-Length" header while reading upstream backend { server 127.0.0.1:$TEST_NGINX_SERVER_PORT; balancer_by_lua_block { + collectgarbage("collect") -- deal with false positive leakage test local ffi = require "ffi" local C = ffi.C ffi.cdef[[ diff --git a/t/143-ssl-session-fetch.t b/t/143-ssl-session-fetch.t index 9cc1870a87..3fbb46e8f4 100644 --- a/t/143-ssl-session-fetch.t +++ b/t/143-ssl-session-fetch.t @@ -7,7 +7,7 @@ use File::Basename; repeat_each(3); -plan tests => repeat_each() * (blocks() * 6) - 3; +plan "no_plan"; my $NginxBinary = $ENV{'TEST_NGINX_BINARY'} || 'nginx'; my $openssl_version = eval { `$NginxBinary -V 2>&1` };