Skip to content

Commit cb07581

Browse files
tests: update test cases to reflect the latest change of ngx_lua. (openresty#384)
1 parent 97d2e5e commit cb07581

13 files changed

+65
-65
lines changed

t/balancer-timeout.t

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ event timer add: \d+: 7689:
205205
--- response_body_like: 500 Internal Server Error
206206
--- error_code: 500
207207
--- error_log eval
208-
qr/\[error\] .*? balancer_by_lua:4: bad connect timeout/
208+
qr/\[error\] .*? balancer_by_lua\(nginx.conf:\d+\):4: bad connect timeout/
209209
--- no_error_log
210210
[warn]
211211
@@ -236,7 +236,7 @@ qr/\[error\] .*? balancer_by_lua:4: bad connect timeout/
236236
--- response_body_like: 500 Internal Server Error
237237
--- error_code: 500
238238
--- error_log eval
239-
qr/\[error\] .*? balancer_by_lua:4: bad connect timeout/
239+
qr/\[error\] .*? balancer_by_lua\(nginx.conf:\d+\):4: bad connect timeout/
240240
--- no_error_log
241241
[warn]
242242
@@ -267,7 +267,7 @@ qr/\[error\] .*? balancer_by_lua:4: bad connect timeout/
267267
--- response_body_like: 500 Internal Server Error
268268
--- error_code: 500
269269
--- error_log eval
270-
qr/\[error\] .*? balancer_by_lua:4: bad send timeout/
270+
qr/\[error\] .*? balancer_by_lua\(nginx.conf:\d+\):4: bad send timeout/
271271
--- no_error_log
272272
[warn]
273273
@@ -298,7 +298,7 @@ qr/\[error\] .*? balancer_by_lua:4: bad send timeout/
298298
--- response_body_like: 500 Internal Server Error
299299
--- error_code: 500
300300
--- error_log eval
301-
qr/\[error\] .*? balancer_by_lua:4: bad send timeout/
301+
qr/\[error\] .*? balancer_by_lua\(nginx.conf:\d+\):4: bad send timeout/
302302
--- no_error_log
303303
[warn]
304304
@@ -329,7 +329,7 @@ qr/\[error\] .*? balancer_by_lua:4: bad send timeout/
329329
--- response_body_like: 500 Internal Server Error
330330
--- error_code: 500
331331
--- error_log eval
332-
qr/\[error\] .*? balancer_by_lua:4: bad read timeout/
332+
qr/\[error\] .*? balancer_by_lua\(nginx.conf:\d+\):4: bad read timeout/
333333
--- no_error_log
334334
[warn]
335335

t/balancer.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ __DATA__
4242
--- error_code: 502
4343
--- error_log eval
4444
[
45-
'[lua] balancer_by_lua:2: hello from balancer by lua! while connecting to upstream,',
45+
'[lua] balancer_by_lua(nginx.conf:29):2: hello from balancer by lua! while connecting to upstream,',
4646
qr{connect\(\) failed .*?, upstream: "http://127\.0\.0\.3:12345/t"},
4747
]
4848
--- no_error_log
@@ -419,7 +419,7 @@ last peer failure: failed 502
419419
--- error_code: 502
420420
--- error_log eval
421421
[
422-
'[lua] balancer_by_lua:2: hello from balancer by lua! while connecting to upstream,',
422+
'[lua] balancer_by_lua(nginx.conf:29):2: hello from balancer by lua! while connecting to upstream,',
423423
qr{connect\(\) failed .*?, upstream: "http://127\.0\.0\.3:12345/t"},
424424
]
425425
--- no_error_log
@@ -457,7 +457,7 @@ qr{connect\(\) failed .*?, upstream: "http://127\.0\.0\.3:12345/t"},
457457
--- error_code: 502
458458
--- error_log eval
459459
[
460-
'[lua] balancer_by_lua:2: hello from balancer by lua! while connecting to upstream,',
460+
'[lua] balancer_by_lua(nginx.conf:30):2: hello from balancer by lua! while connecting to upstream,',
461461
qr{connect\(\) failed .*?, upstream: "http://127\.0\.0\.3:12345/t"},
462462
]
463463
--- no_error_log

t/misc.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ GET /t
3939
bad argument
4040
--- error_log eval
4141
["is subrequest: false,",
42-
qr/\[TRACE\s+\d+\s+header_filter_by_lua:3 loop\]/
42+
qr/\[TRACE\s+\d+\s+header_filter_by_lua\(nginx.conf:58\):3 loop\]/
4343
]
4444

4545

t/process-type-cache.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ GET /t
6060
--- response_body
6161
type: worker
6262
--- grep_error_log eval
63-
qr/\[TRACE\s+\d+ init_worker_by_lua:\d+ loop\]|\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):\d loop\]/
63+
qr/\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]|\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):\d loop\]/
6464
--- grep_error_log_out eval
6565
[
66-
qr/\[TRACE\s+\d+ init_worker_by_lua:\d+ loop\]
66+
qr/\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]
6767
\[TRACE\s+\d+ content_by_lua\(nginx.conf:\d+\):\d+ loop\]
6868
/,
69-
qr/\[TRACE\s+\d+ init_worker_by_lua:\d+ loop\]
69+
qr/\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]
7070
\[TRACE\s+\d+ content_by_lua\(nginx.conf:\d+\):\d+ loop\]
7171
/
7272
]

t/process-type-hup.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ GET /t
8282
--- response_body
8383
type: worker
8484
--- error_log
85-
init_worker_by_lua:6: process type: privileged
85+
init_worker_by_lua(nginx.conf:48):6: process type: privileged
8686
--- no_error_log
8787
[error]
8888
--- skip_nginx: 4: < 1.11.2

t/process-type-master.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ GET /t
5353
--- response_body
5454
process type: master
5555
--- grep_error_log eval
56-
qr/\[TRACE\s+\d+ init_by_lua:\d+ loop\]/
56+
qr/\[TRACE\s+\d+ init_by_lua\(nginx.conf:\d+\):\d+ loop\]/
5757
--- grep_error_log_out eval
5858
[
59-
qr/\A\[TRACE\s+\d+ init_by_lua:\d+ loop\]
59+
qr/\A\[TRACE\s+\d+ init_by_lua\(nginx.conf:\d+\):\d+ loop\]
6060
\z/,
61-
qr/\A\[TRACE\s+\d+ init_by_lua:\d+ loop\]
61+
qr/\A\[TRACE\s+\d+ init_by_lua\(nginx.conf:\d+\):\d+ loop\]
6262
\z/
6363
]
6464
--- no_error_log

t/process-type-privileged-agent.t

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,18 @@ GET /t
9191
--- response_body
9292
type: worker
9393
--- grep_error_log eval
94-
qr/\[TRACE\s+\d+ init_worker_by_lua:\d+ loop\]|\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):\d+ loop\]|init_worker_by_lua:\d+: process type: \w+/
94+
qr/\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]|\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):\d+ loop\]|init_worker_by_lua\(nginx.conf:\d+\):\d+: process type: \w+/
9595
--- grep_error_log_out eval
9696
[
97-
qr/\[TRACE\s+\d+ init_worker_by_lua:\d+ loop\]
98-
(?:\[TRACE\s+\d+ init_worker_by_lua:\d+ loop\]
97+
qr/\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]
98+
(?:\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]
9999
)?\[TRACE\s+\d+ content_by_lua\(nginx.conf:\d+\):\d+ loop\]
100-
init_worker_by_lua:10: process type: privileged
100+
init_worker_by_lua\(nginx.conf:\d+\):10: process type: privileged
101101
/,
102-
qr/\[TRACE\s+\d+ init_worker_by_lua:\d+ loop\]
103-
(?:\[TRACE\s+\d+ init_worker_by_lua:\d+ loop\]
102+
qr/\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]
103+
(?:\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]
104104
)?\[TRACE\s+\d+ content_by_lua\(nginx.conf:\d+\):\d+ loop\]
105-
init_worker_by_lua:10: process type: privileged
105+
init_worker_by_lua\(nginx.conf:\d+\):10: process type: privileged
106106
/
107107
]
108108
--- no_error_log

t/process-type-single.t

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,20 @@ GET /t
6767
--- response_body
6868
process type: single
6969
--- grep_error_log eval
70-
qr/\[TRACE\s+\d+ init_by_lua:\d+ loop\]|\[TRACE\s+\d+ init_worker_by_lua:\d loop\]|\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):\d loop\]|process type in init_by_lua\*: \w+|init_worker_by_lua:\d+: process type: \w+/
70+
qr/\[TRACE\s+\d+ init_by_lua\(nginx.conf:\d+\):\d+ loop\]|\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d loop\]|\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):\d loop\]|process type in init_by_lua\*: \w+|init_worker_by_lua\(nginx.conf:\d+\):\d+: process type: \w+/
7171
--- grep_error_log_out eval
7272
[
73-
qr/\[TRACE\s+\d+ init_by_lua:\d+ loop\]
74-
\[TRACE\s+\d+ init_worker_by_lua:\d+ loop\]
73+
qr/\[TRACE\s+\d+ init_by_lua\(nginx.conf:\d+\):\d+ loop\]
74+
\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]
7575
\[TRACE\s+\d+ content_by_lua\(nginx.conf:\d+\):4 loop\]
7676
process type in init_by_lua\*: single
77-
init_worker_by_lua:10: process type: single
77+
init_worker_by_lua\(nginx.conf:\d+\):10: process type: single
7878
/,
79-
qr/\[TRACE\s+\d+ init_by_lua:\d+ loop\]
80-
\[TRACE\s+\d+ init_worker_by_lua:\d+ loop\]
79+
qr/\[TRACE\s+\d+ init_by_lua\(nginx.conf:\d+\):\d+ loop\]
80+
\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]
8181
\[TRACE\s+\d+ content_by_lua\(nginx.conf:\d+\):4 loop\]
8282
process type in init_by_lua\*: single
83-
init_worker_by_lua:10: process type: single
83+
init_worker_by_lua\(nginx.conf:\d+\):10: process type: single
8484
/
8585
]
8686
--- no_error_log

t/process-type-worker.t

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ GET /t
5555
--- response_body
5656
process type: worker
5757
--- grep_error_log eval
58-
qr/\[TRACE\s+\d+ init_worker_by_lua:\d loop\]|\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):\d loop\]|init_worker_by_lua:\d: process type: \w+/
58+
qr/\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d loop\]|\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):\d loop\]|init_worker_by_lua\(nginx.conf:\d+\):\d: process type: \w+/
5959
--- grep_error_log_out eval
6060
[
61-
qr/\[TRACE\s+\d+ init_worker_by_lua:4 loop\]
61+
qr/\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):4 loop\]
6262
\[TRACE\s+\d+ content_by_lua\(nginx.conf:\d+\):4 loop\]
63-
init_worker_by_lua:8: process type: worker
63+
init_worker_by_lua\(nginx.conf:\d+\):8: process type: worker
6464
/,
65-
qr/\[TRACE\s+\d+ init_worker_by_lua:4 loop\]
65+
qr/\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):4 loop\]
6666
\[TRACE\s+\d+ content_by_lua\(nginx.conf:\d+\):4 loop\]
67-
init_worker_by_lua:8: process type: worker
67+
init_worker_by_lua\(nginx.conf:\d+\):8: process type: worker
6868
/
6969
]
7070
--- no_error_log

t/semaphore.t

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,10 @@ GET /test
304304
sem count: [12]
305305
waited successfully.
306306
--- grep_error_log eval
307-
qr/\[lua\] init_by_lua:\d+: sema created: table: 0x[a-f0-9]+/
307+
qr/\[lua\] init_by_lua\(nginx.conf:\d+\):\d+: sema created: table: 0x[a-f0-9]+/
308308
--- grep_error_log_out eval
309309
[
310-
qr/\[lua\] init_by_lua:\d+: sema created: table: 0x[a-f0-9]+/,
310+
qr/\[lua\] init_by_lua\(nginx.conf:\d+\):\d+: sema created: table: 0x[a-f0-9]+/,
311311
"",
312312
]
313313
@@ -348,10 +348,10 @@ GET /test
348348
sem count: [12]
349349
waited successfully.
350350
--- grep_error_log eval
351-
qr/\[lua\] init_by_lua:\d+: sema created: table: 0x[a-f0-9]+/
351+
qr/\[lua\] init_by_lua\(nginx.conf:\d+\):\d+: sema created: table: 0x[a-f0-9]+/
352352
--- grep_error_log_out eval
353353
[
354-
qr/\[lua\] init_by_lua:\d+: sema created: table: 0x[a-f0-9]+/,
354+
qr/\[lua\] init_by_lua\(nginx.conf:\d+\):\d+: sema created: table: 0x[a-f0-9]+/,
355355
"",
356356
]
357357

0 commit comments

Comments
 (0)