updated tests to reflect recent changes in rewrite_by_lua* and access_by_lua*.

This commit is contained in:
Yichun Zhang (agentzh) 2014-05-22 14:53:15 -07:00
Родитель 4f0be44f75
Коммит 34ab51f89f
11 изменённых файлов: 18 добавлений и 298 удалений

Просмотреть файл

@ -395,7 +395,6 @@ callback done: +OK
ngx.sleep(0.7)
ngx.log(ngx.NOTICE, "main handler done")
';
content_by_lua return;
}
--- request
GET /t
@ -405,8 +404,6 @@ GET /t
--- stap_out
terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
lua req cleanup
--- timeout: 0.2
@ -435,7 +432,6 @@ main handler done
ngx.say("done")
';
content_by_lua return;
}
--- request
GET /t
@ -446,10 +442,8 @@ GET /t
create 2 in 1
terminate 1: ok
delete thread 1
delete thread 2
terminate 3: ok
delete thread 3
lua req cleanup
delete thread 2
--- response_body
done
@ -597,10 +591,8 @@ terminate 1: ok
delete thread 1
terminate 3: ok
delete thread 3
delete thread 2
terminate 4: ok
delete thread 4
lua req cleanup
delete thread 2
--- wait: 0.5
--- response_body
@ -652,10 +644,8 @@ GET /t
create 2 in 1
terminate 1: ok
delete thread 1
delete thread 2
terminate 3: ok
delete thread 3
lua req cleanup
delete thread 2
--- response_body
2: cannot set on_abort: duplicate call

Просмотреть файл

@ -281,7 +281,6 @@ hello foo
ngx.location.capture("/sleep")
ngx.say("end")
';
content_by_lua return;
}
location = /sleep {
@ -340,8 +339,6 @@ expire timer 200
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- wait: 0.1

Просмотреть файл

@ -36,7 +36,6 @@ __DATA__
ngx.sleep(1)
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -76,8 +75,6 @@ spawn user thread 2 in 1
terminate 2: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
--- response_body
before
@ -103,7 +100,6 @@ hello in thread
ngx.sleep(1)
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -161,8 +157,6 @@ lua sleep cleanup
delete timer 1000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- response_body
@ -194,7 +188,6 @@ after
ngx.thread.spawn(g)
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -256,8 +249,6 @@ lua sleep cleanup
delete timer 1000
delete thread 2
delete thread 3
terminate 4: ok
delete thread 4
free request
--- response_body
@ -282,7 +273,6 @@ f
ngx.thread.spawn(f)
ngx.say("after")
';
content_by_lua return;
}
--- request
GET /lua
@ -295,8 +285,6 @@ terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
--- wait: 0.1
--- response_body
@ -331,7 +319,6 @@ exiting the user thread
end
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -403,8 +390,6 @@ lua tcp resolve cleanup
delete timer 12000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- response_body
@ -440,7 +425,6 @@ after
end
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -512,8 +496,6 @@ lua udp resolve cleanup
delete timer 12000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- response_body
@ -547,7 +529,6 @@ after
end
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -605,8 +586,6 @@ lua tcp socket cleanup
delete timer 12000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- response_body
@ -655,7 +634,6 @@ after
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -708,8 +686,6 @@ lua tcp socket cleanup
delete timer 12000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- response_body
@ -764,7 +740,6 @@ after
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -817,8 +792,6 @@ lua tcp socket cleanup
delete timer 12000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- response_body
@ -861,7 +834,6 @@ after
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -914,8 +886,6 @@ lua udp socket cleanup
delete timer 12000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- wait: 0.1
@ -953,7 +923,6 @@ after
ngx.say("end")
';
content_by_lua return;
}
--- request
POST /lua
@ -1010,8 +979,6 @@ lua tcp socket cleanup
delete timer 12000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- wait: 0.1
@ -1043,7 +1010,6 @@ after
ngx.say("end")
';
content_by_lua return;
}
--- request
POST /lua
@ -1098,8 +1064,6 @@ lua req body cleanup
delete timer 12000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- wait: 0.1
@ -1131,7 +1095,6 @@ after
ngx.say("end")
';
content_by_lua return;
}
location = /sleep {
@ -1186,8 +1149,6 @@ expire timer 200
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- wait: 0.1
@ -1216,7 +1177,6 @@ attempt to abort with pending subrequests
ngx.location.capture("/sleep")
ngx.say("end")
';
content_by_lua return;
}
location = /sleep {
@ -1277,8 +1237,6 @@ post subreq /sleep
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- wait: 0.1
@ -1307,7 +1265,6 @@ attempt to abort with pending subrequests
}
ngx.say("end")
';
content_by_lua return;
}
location = /echo {
@ -1372,8 +1329,6 @@ post subreq /sleep
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- wait: 0.1

Просмотреть файл

@ -39,7 +39,6 @@ __DATA__
}
ngx.say("end")
';
content_by_lua return;
}
location = /echo {
@ -104,8 +103,6 @@ post subreq /sleep
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- response_body

Просмотреть файл

@ -32,7 +32,6 @@ __DATA__
ngx.thread.spawn(f)
ngx.say("after")
';
content_by_lua return;
}
--- request
GET /lua
@ -56,8 +55,6 @@ terminate 2: ok
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
--- response_body
before
@ -88,7 +85,6 @@ after
ngx.thread.spawn(g)
ngx.say("after 2")
';
content_by_lua return;
}
--- request
GET /lua
@ -105,8 +101,6 @@ terminate 1: ok
delete thread 2
delete thread 3
delete thread 1
terminate 4: ok
delete thread 4
--- response_body
before 1
@ -134,7 +128,6 @@ after 2
ngx.thread.spawn(f)
ngx.say("after thread create")
';
content_by_lua return;
}
--- request
GET /lua
@ -147,8 +140,6 @@ terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
--- response_body
before thread create
@ -184,7 +175,6 @@ after sleep
ngx.thread.spawn(g)
ngx.say("2: after thread create")
';
content_by_lua return;
}
--- request
GET /lua
@ -201,8 +191,6 @@ terminate 3: ok
delete thread 3
terminate 2: ok
delete thread 2
terminate 4: ok
delete thread 4
--- wait: 0.1
--- response_body
@ -230,7 +218,6 @@ delete thread 4
ngx.thread.spawn(f)
ngx.say("after")
';
content_by_lua return;
}
--- request
GET /lua
@ -243,8 +230,6 @@ terminate 2: fail
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
--- response_body
after
@ -267,7 +252,6 @@ lua user thread aborted: runtime error: rewrite_by_lua:3: attempt to call field
ngx.thread.spawn(f)
ngx.say("after thread create")
';
content_by_lua return;
}
location /proxy {
@ -289,8 +273,6 @@ terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
--- response_body
before thread create
@ -318,7 +300,6 @@ after capture: hello world
local res = ngx.location.capture("/proxy?bar")
ngx.say("capture: ", res.body)
';
content_by_lua return;
}
location /proxy {
@ -344,8 +325,6 @@ terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
--- response_body
before thread create
@ -374,7 +353,6 @@ after capture: hello foo
local res = ngx.location.capture("/proxy?bar")
ngx.say("capture: ", res.body)
';
content_by_lua return;
}
location /proxy {
@ -401,8 +379,6 @@ terminate 2: ok
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
--- response_body
before thread create
@ -442,7 +418,6 @@ capture: hello bar
local res = ngx.location.capture("/proxy?bar")
ngx.say("capture: ", res.body)
';
content_by_lua return;
}
location /proxy {
@ -478,8 +453,6 @@ delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
terminate 4: ok
delete thread 4
--- response_body
before thread 1 create
@ -514,7 +487,6 @@ g: after capture: hello bah
ngx.thread.spawn(f)
ngx.say("after f")
';
content_by_lua return;
}
--- request
GET /lua
@ -531,8 +503,6 @@ delete thread 1
terminate 2: ok
delete thread 3
delete thread 2
terminate 4: ok
delete thread 4
--- response_body
before f
@ -564,7 +534,6 @@ after g
ngx.thread.spawn(f)
ngx.say("after f")
';
content_by_lua return;
}
--- request
GET /lua
@ -581,8 +550,6 @@ terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
terminate 4: ok
delete thread 4
--- response_body
before f
@ -608,7 +575,6 @@ hello in g()
ngx.thread.spawn(f)
ngx.say("status: ", coroutine.status(co))
';
content_by_lua return;
}
--- request
GET /lua
@ -621,8 +587,6 @@ terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
--- response_body
status: running
@ -643,7 +607,6 @@ status: running
ngx.thread.spawn(f)
ngx.say("status: ", coroutine.status(co))
';
content_by_lua return;
}
--- request
GET /lua
@ -656,8 +619,6 @@ terminate 2: ok
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
--- response_body
status: zombie
@ -684,7 +645,6 @@ status: zombie
ngx.thread.spawn(f)
ngx.say("status: ", coroutine.status(co))
';
content_by_lua return;
}
--- request
GET /lua
@ -699,8 +659,6 @@ delete thread 1
terminate 3: ok
terminate 2: ok
delete thread 2
terminate 4: ok
delete thread 4
--- response_body
status: normal
@ -728,7 +686,6 @@ status: normal
coroutine.resume(co)
ngx.say("after f")
';
content_by_lua return;
}
--- request
GET /lua
@ -743,8 +700,6 @@ terminate 2: ok
delete thread 3
terminate 1: ok
delete thread 1
terminate 4: ok
delete thread 4
--- response_body
before f
@ -783,7 +738,6 @@ after f
yield(self)
ngx.say("4")
';
content_by_lua return;
}
--- request
GET /lua
@ -796,8 +750,6 @@ terminate 2: ok
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
--- response_body
0
@ -841,7 +793,6 @@ f 3
ngx.thread.spawn(g)
ngx.say("done")
';
content_by_lua return;
}
--- request
GET /lua
@ -858,8 +809,6 @@ terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
terminate 4: ok
delete thread 4
--- response_body
f 1
@ -889,7 +838,6 @@ g 3
ngx.say("after")
ngx.flush(true)
';
content_by_lua return;
}
--- request
GET /lua
@ -902,8 +850,6 @@ terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
--- response_body
before
@ -931,7 +877,6 @@ after
ngx.thread.spawn(f)
ngx.thread.spawn(g)
';
content_by_lua return;
}
--- request
GET /lua
@ -956,9 +901,7 @@ terminate 3: ok
terminate 1: ok
delete thread 2
delete thread 3
delete thread 1)
terminate 4: ok
delete thread 4$
delete thread 1)$
--- response_body
hello from f
@ -998,7 +941,6 @@ hello from g
ngx.thread.spawn(f)
ngx.say("after")
';
content_by_lua return;
}
--- request
GET /lua
@ -1011,8 +953,6 @@ terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
--- response_body
before
@ -1049,7 +989,6 @@ received: OK
ngx.thread.spawn(f)
ngx.say("after")
';
content_by_lua return;
}
--- request
GET /lua
@ -1062,16 +1001,12 @@ terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
|create 2 in 1
spawn user thread 2 in 1
terminate 2: ok
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3)$
delete thread 1)$
--- udp_listen: 12345
--- udp_query: blah
@ -1121,9 +1056,7 @@ spawn user thread 2 in 1
terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2)
terminate 3: ok
delete thread 3$
delete thread 2)$
--- response_body_like chop
^(?:before
@ -1156,7 +1089,6 @@ body: hello world)$
ngx.thread.spawn(f)
ngx.say("after")
';
content_by_lua return;
}
--- request
POST /lua
@ -1174,9 +1106,7 @@ spawn user thread 2 in 1
terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2)
terminate 3: ok
delete thread 3$
delete thread 2)$
--- response_body_like chop
^(?:before
@ -1210,7 +1140,6 @@ body: hello world)$
ngx.say("ok")
';
content_by_lua return;
}
location ~ ^/proxy/(\d+) {
@ -1257,9 +1186,7 @@ post subreq: /proxy/2 rc=404, status=0 a=0
subrequest /proxy/2 done
terminate 3: ok
delete thread 3
terminate 4: ok
delete thread 4
finalize request /t: rc:0 c:1 a:1
finalize request /t: rc:200 c:1 a:1
(?:finalize request /t: rc:0 c:1 a:1)?$
--- response_body
@ -1292,7 +1219,6 @@ status: 404
ngx.say("ok")
';
content_by_lua return;
}
location ~ ^/proxy/(\d+) {
@ -1338,9 +1264,7 @@ delete thread 4
terminate 3: ok
delete thread 3
terminate 2: ok
delete thread 2)
terminate 7: ok
delete thread 7
delete thread 2)$
--- response_body
ok
@ -1375,7 +1299,6 @@ status: 404
ngx.say("ok")
';
content_by_lua return;
}
location ~ ^/proxy/(\d+) {
@ -1433,9 +1356,7 @@ post subreq: /proxy/2 rc=0, status=201 a=0
subrequest /proxy/2 done
terminate 3: ok
delete thread 3
terminate 6: ok
delete thread 6
finalize request /t: rc:0 c:1 a:1
finalize request /t: rc:200 c:1 a:1
(?:finalize request /t: rc:0 c:1 a:1)?$
--- response_body
@ -1468,7 +1389,6 @@ status: 201
ngx.say("ok")
';
content_by_lua return;
}
location ~ ^/proxy/(\d+) {
@ -1520,9 +1440,7 @@ post subreq: /proxy/2 rc=204, status=204 a=0
subrequest /proxy/2 done
terminate 3: ok
delete thread 3
terminate 6: ok
delete thread 6
finalize request /t: rc:0 c:1 a:1
finalize request /t: rc:200 c:1 a:1
(?:finalize request /t: rc:0 c:1 a:1)?$
--- response_body

Просмотреть файл

@ -232,7 +232,6 @@ on abort called
ngx.location.capture("/sleep")
';
content_by_lua return;
}
location = /sleep {
@ -394,7 +393,6 @@ callback done: +OK
ngx.sleep(0.7)
ngx.log(ngx.NOTICE, "main handler done")
';
content_by_lua return;
}
--- request
GET /t
@ -404,8 +402,6 @@ GET /t
--- stap_out
terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
lua req cleanup
--- timeout: 0.2
@ -434,7 +430,6 @@ main handler done
ngx.say("done")
';
content_by_lua return;
}
--- request
GET /t
@ -445,10 +440,8 @@ GET /t
create 2 in 1
terminate 1: ok
delete thread 1
delete thread 2
terminate 3: ok
delete thread 3
lua req cleanup
delete thread 2
--- response_body
done
@ -581,7 +574,6 @@ on abort called
ngx.say("done")
end)
';
content_by_lua return;
}
--- request
GET /t
@ -596,10 +588,8 @@ terminate 1: ok
delete thread 1
terminate 3: ok
delete thread 3
delete thread 2
terminate 4: ok
delete thread 4
lua req cleanup
delete thread 2
--- response_body
done
@ -639,7 +629,6 @@ main handler done
ngx.say("done")
end)
';
content_by_lua return;
}
--- request
GET /t
@ -650,10 +639,8 @@ GET /t
create 2 in 1
terminate 1: ok
delete thread 1
delete thread 2
terminate 3: ok
delete thread 3
lua req cleanup
delete thread 2
--- response_body
2: cannot set on_abort: duplicate call

Просмотреть файл

@ -282,7 +282,6 @@ hello foo
ngx.location.capture("/sleep")
ngx.say("end")
';
content_by_lua return;
}
location = /sleep {
@ -341,8 +340,6 @@ expire timer 200
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- wait: 0.1

Просмотреть файл

@ -36,7 +36,6 @@ __DATA__
ngx.sleep(1)
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -76,8 +75,6 @@ spawn user thread 2 in 1
terminate 2: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
--- response_body
before
@ -103,7 +100,6 @@ hello in thread
ngx.sleep(1)
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -161,8 +157,6 @@ lua sleep cleanup
delete timer 1000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- wait: 0.1
@ -194,7 +188,6 @@ after
ngx.thread.spawn(g)
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -256,8 +249,6 @@ lua sleep cleanup
delete timer 1000
delete thread 2
delete thread 3
terminate 4: ok
delete thread 4
free request
--- response_body
@ -282,7 +273,6 @@ f
ngx.thread.spawn(f)
ngx.say("after")
';
content_by_lua return;
}
--- request
GET /lua
@ -295,8 +285,6 @@ terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
--- wait: 0.1
--- response_body
@ -331,7 +319,6 @@ exiting the user thread
end
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -394,8 +381,6 @@ lua tcp resolve cleanup
delete timer 12000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- response_body
@ -430,7 +415,6 @@ after
end
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -493,8 +477,6 @@ lua udp resolve cleanup
delete timer 12000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- response_body
@ -528,7 +510,6 @@ after
end
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -586,8 +567,6 @@ lua tcp socket cleanup
delete timer 12000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- response_body
@ -636,7 +615,6 @@ after
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -689,8 +667,6 @@ lua tcp socket cleanup
delete timer 12000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- response_body
@ -745,7 +721,6 @@ after
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -798,8 +773,6 @@ lua tcp socket cleanup
delete timer 12000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- response_body
@ -842,7 +815,6 @@ after
ngx.say("end")
';
content_by_lua return;
}
--- request
GET /lua
@ -895,8 +867,6 @@ lua udp socket cleanup
delete timer 12000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- wait: 0.1
@ -934,7 +904,6 @@ after
ngx.say("end")
';
content_by_lua return;
}
--- request
POST /lua
@ -991,8 +960,6 @@ lua tcp socket cleanup
delete timer 12000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- wait: 0.1
@ -1024,7 +991,6 @@ after
ngx.say("end")
';
content_by_lua return;
}
--- request
POST /lua
@ -1079,8 +1045,6 @@ lua req body cleanup
delete timer 12000
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- wait: 0.1
@ -1112,7 +1076,6 @@ after
ngx.say("end")
';
content_by_lua return;
}
location = /sleep {
@ -1167,8 +1130,6 @@ expire timer 200
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- wait: 0.1
@ -1197,7 +1158,6 @@ attempt to abort with pending subrequests
ngx.location.capture("/sleep")
ngx.say("end")
';
content_by_lua return;
}
location = /sleep {
@ -1258,8 +1218,6 @@ post subreq /sleep
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- wait: 0.1
@ -1288,7 +1246,6 @@ attempt to abort with pending subrequests
}
ngx.say("end")
';
content_by_lua return;
}
location = /echo {
@ -1353,8 +1310,6 @@ post subreq /sleep
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- wait: 0.1

Просмотреть файл

@ -39,7 +39,6 @@ __DATA__
}
ngx.say("end")
';
content_by_lua return;
}
location = /echo {
@ -104,8 +103,6 @@ post subreq /sleep
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- response_body

Просмотреть файл

@ -32,7 +32,6 @@ __DATA__
ngx.thread.spawn(f)
ngx.say("after")
';
content_by_lua return;
}
--- request
GET /lua
@ -56,8 +55,6 @@ terminate 2: ok
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
--- response_body
before
@ -88,7 +85,6 @@ after
ngx.thread.spawn(g)
ngx.say("after 2")
';
content_by_lua return;
}
--- request
GET /lua
@ -105,8 +101,6 @@ terminate 1: ok
delete thread 2
delete thread 3
delete thread 1
terminate 4: ok
delete thread 4
--- response_body
before 1
@ -134,7 +128,6 @@ after 2
ngx.thread.spawn(f)
ngx.say("after thread create")
';
content_by_lua return;
}
--- request
GET /lua
@ -147,8 +140,6 @@ terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
--- response_body
before thread create
@ -184,7 +175,6 @@ after sleep
ngx.thread.spawn(g)
ngx.say("2: after thread create")
';
content_by_lua return;
}
--- request
GET /lua
@ -201,8 +191,6 @@ terminate 3: ok
delete thread 3
terminate 2: ok
delete thread 2
terminate 4: ok
delete thread 4
--- wait: 0.1
--- response_body
@ -230,7 +218,6 @@ delete thread 4
ngx.thread.spawn(f)
ngx.say("after")
';
content_by_lua return;
}
--- request
GET /lua
@ -243,8 +230,6 @@ terminate 2: fail
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
--- response_body
after
@ -267,7 +252,6 @@ lua user thread aborted: runtime error: access_by_lua:3: attempt to call field '
ngx.thread.spawn(f)
ngx.say("after thread create")
';
content_by_lua return;
}
location /proxy {
@ -289,8 +273,6 @@ terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
--- response_body
before thread create
@ -318,7 +300,6 @@ after capture: hello world
local res = ngx.location.capture("/proxy?bar")
ngx.say("capture: ", res.body)
';
content_by_lua return;
}
location /proxy {
@ -344,8 +325,6 @@ terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
--- response_body
before thread create
@ -401,8 +380,6 @@ terminate 2: ok
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
--- response_body
before thread create
@ -442,7 +419,6 @@ capture: hello bar
local res = ngx.location.capture("/proxy?bar")
ngx.say("capture: ", res.body)
';
content_by_lua return;
}
location /proxy {
@ -478,8 +454,6 @@ delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
terminate 4: ok
delete thread 4
--- response_body
before thread 1 create
@ -514,7 +488,6 @@ g: after capture: hello bah
ngx.thread.spawn(f)
ngx.say("after f")
';
content_by_lua return;
}
--- request
GET /lua
@ -531,8 +504,6 @@ delete thread 1
terminate 2: ok
delete thread 3
delete thread 2
terminate 4: ok
delete thread 4
--- response_body
before f
@ -564,7 +535,6 @@ after g
ngx.thread.spawn(f)
ngx.say("after f")
';
content_by_lua return;
}
--- request
GET /lua
@ -581,8 +551,6 @@ terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
terminate 4: ok
delete thread 4
--- response_body
before f
@ -608,7 +576,6 @@ hello in g()
ngx.thread.spawn(f)
ngx.say("status: ", coroutine.status(co))
';
content_by_lua return;
}
--- request
GET /lua
@ -621,8 +588,6 @@ terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
--- response_body
status: running
@ -643,7 +608,6 @@ status: running
ngx.thread.spawn(f)
ngx.say("status: ", coroutine.status(co))
';
content_by_lua return;
}
--- request
GET /lua
@ -656,8 +620,6 @@ terminate 2: ok
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
--- response_body
status: zombie
@ -684,7 +646,6 @@ status: zombie
ngx.thread.spawn(f)
ngx.say("status: ", coroutine.status(co))
';
content_by_lua return;
}
--- request
GET /lua
@ -699,8 +660,6 @@ delete thread 1
terminate 3: ok
terminate 2: ok
delete thread 2
terminate 4: ok
delete thread 4
--- response_body
status: normal
@ -728,7 +687,6 @@ status: normal
coroutine.resume(co)
ngx.say("after f")
';
content_by_lua return;
}
--- request
GET /lua
@ -743,8 +701,6 @@ terminate 2: ok
delete thread 3
terminate 1: ok
delete thread 1
terminate 4: ok
delete thread 4
--- response_body
before f
@ -783,7 +739,6 @@ after f
yield(self)
ngx.say("4")
';
content_by_lua return;
}
--- request
GET /lua
@ -796,8 +751,6 @@ terminate 2: ok
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
--- response_body
0
@ -841,7 +794,6 @@ f 3
ngx.thread.spawn(g)
ngx.say("done")
';
content_by_lua return;
}
--- request
GET /lua
@ -858,8 +810,6 @@ terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
terminate 4: ok
delete thread 4
--- response_body
f 1
@ -889,7 +839,6 @@ g 3
ngx.say("after")
ngx.flush(true)
';
content_by_lua return;
}
--- request
GET /lua
@ -902,8 +851,6 @@ terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
--- response_body
before
@ -931,7 +878,6 @@ after
ngx.thread.spawn(f)
ngx.thread.spawn(g)
';
content_by_lua return;
}
--- request
GET /lua
@ -956,9 +902,7 @@ terminate 3: ok
terminate 1: ok
delete thread 2
delete thread 3
delete thread 1)
terminate 4: ok
delete thread 4$
delete thread 1)$
--- response_body
hello from f
@ -998,7 +942,6 @@ hello from g
ngx.thread.spawn(f)
ngx.say("after")
';
content_by_lua return;
}
--- request
GET /lua
@ -1011,8 +954,6 @@ terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
--- response_body
before
@ -1049,7 +990,6 @@ received: OK
ngx.thread.spawn(f)
ngx.say("after")
';
content_by_lua return;
}
--- request
GET /lua
@ -1062,16 +1002,12 @@ terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
terminate 3: ok
delete thread 3
|create 2 in 1
spawn user thread 2 in 1
terminate 2: ok
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3)$
delete thread 1)$
--- udp_listen: 12345
--- udp_query: blah
@ -1103,7 +1039,6 @@ after)$
ngx.thread.spawn(f)
ngx.say("after")
';
content_by_lua return;
}
--- request
POST /lua
@ -1121,9 +1056,7 @@ spawn user thread 2 in 1
terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2)
terminate 3: ok
delete thread 3$
delete thread 2)$
--- response_body_like chop
^(?:before
@ -1156,7 +1089,6 @@ body: hello world)$
ngx.thread.spawn(f)
ngx.say("after")
';
content_by_lua return;
}
--- request
POST /lua
@ -1174,9 +1106,7 @@ spawn user thread 2 in 1
terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2)
terminate 3: ok
delete thread 3$
delete thread 2)$
--- response_body_like chop
^(?:before

Просмотреть файл

@ -277,7 +277,6 @@ hello foo
ngx.location.capture("/sleep")
ngx.say("end")
';
content_by_lua return;
}
location = /sleep {
@ -342,8 +341,6 @@ post subreq /sleep
terminate 1: ok
delete thread 2
delete thread 1
terminate 3: ok
delete thread 3
free request
--- response_body