Skip to content

Commit f039836

Browse files
authored
tests: stabilize flaky tests in CI.
Signed-off-by: tzssangglass <tzssangglass@gmail.com>
1 parent 75566fc commit f039836

4 files changed

Lines changed: 56 additions & 57 deletions

File tree

‎t/024-access/on-abort.t‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ delete thread 1
372372
$
373373
--- timeout: 0.2
374374
--- abort
375-
--- wait: 0.2
375+
--- wait: 1
376376
--- ignore_response
377377
--- no_error_log
378378
[error]

‎t/124-init-worker.t‎

Lines changed: 51 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -784,24 +784,23 @@ ok
784784
GET /t
785785
--- grep_error_log eval: qr/lua close the global Lua VM \S+ in the cache helper process \d+|lua close the global Lua VM \S+$/
786786
--- grep_error_log_out eval
787-
qr/\A(?:lua close the global Lua VM ([0-9A-F]+) in the cache helper process \d+
788-
lua close the global Lua VM \1
789-
lua close the global Lua VM \1 in the cache helper process \d+
790-
lua close the global Lua VM \1
791-
|lua close the global Lua VM ([0-9A-F]+) in the cache helper process \d+
792-
lua close the global Lua VM \2 in the cache helper process \d+
793-
lua close the global Lua VM \2
794-
lua close the global Lua VM \2
795-
|lua close the global Lua VM ([0-9A-F]+)
796-
lua close the global Lua VM \3 in the cache helper process \d+
797-
lua close the global Lua VM \3
798-
lua close the global Lua VM \3 in the cache helper process \d+
799-
|lua close the global Lua VM ([0-9A-F]+)
800-
lua close the global Lua VM \4 in the cache helper process \d+
801-
lua close the global Lua VM \4 in the cache helper process \d+
802-
lua close the global Lua VM \4
803-
)(?:lua close the global Lua VM [0-9A-F]+
804-
)*\z/
787+
do {
788+
my $close = qr/lua close the global Lua VM /;
789+
my $helper = qr/${close}[0-9A-F]+ in the cache helper process \d+\n/;
790+
my $plain = qr/${close}[0-9A-F]+\n/;
791+
my $suffix = qr/ in the cache helper process \d+/;
792+
my $skip = qr/(?:[^\n]*\n)*?/;
793+
794+
qr/
795+
\A
796+
(?= $skip $helper $skip $helper ) # at least 2 helper lines
797+
(?! $skip $helper $skip $helper $skip $helper ) # but not a 3rd one
798+
(?= $skip $plain $skip $plain ) # at least 2 plain lines
799+
$close ([0-9A-F]+) (?:$suffix)? \n # 1st line pins the VM address
800+
(?: $close \1 (?:$suffix)? \n )* # later lines: same address
801+
\z
802+
/x;
803+
}
805804
--- no_error_log
806805
[error]
807806
start privileged agent process
@@ -830,25 +829,23 @@ start privileged agent process
830829
GET /t
831830
--- grep_error_log eval: qr/lua close the global Lua VM \S+ in the cache helper process \d+|lua close the global Lua VM \S+$/
832831
--- grep_error_log_out eval
833-
qr/\A(?:lua close the global Lua VM ([0-9A-F]+) in the cache helper process \d+
834-
lua close the global Lua VM \1
835-
lua close the global Lua VM \1 in the cache helper process \d+
836-
lua close the global Lua VM \1
837-
|lua close the global Lua VM ([0-9A-F]+) in the cache helper process \d+
838-
lua close the global Lua VM \2 in the cache helper process \d+
839-
lua close the global Lua VM \2
840-
lua close the global Lua VM \2
841-
|lua close the global Lua VM ([0-9A-F]+)
842-
lua close the global Lua VM \3 in the cache helper process \d+
843-
lua close the global Lua VM \3
844-
lua close the global Lua VM \3 in the cache helper process \d+
845-
)(?:lua close the global Lua VM [0-9A-F]+
846-
|lua close the global Lua VM ([0-9A-F]+)
847-
lua close the global Lua VM \4 in the cache helper process \d+
848-
lua close the global Lua VM \4 in the cache helper process \d+
849-
lua close the global Lua VM \4
850-
lua close the global Lua VM \4
851-
)*\z/
832+
do {
833+
my $close = qr/lua close the global Lua VM /;
834+
my $helper = qr/${close}[0-9A-F]+ in the cache helper process \d+\n/;
835+
my $plain = qr/${close}[0-9A-F]+\n/;
836+
my $suffix = qr/ in the cache helper process \d+/;
837+
my $skip = qr/(?:[^\n]*\n)*?/;
838+
839+
qr/
840+
\A
841+
(?= $skip $helper $skip $helper ) # at least 2 helper lines
842+
(?! $skip $helper $skip $helper $skip $helper ) # but not a 3rd one
843+
(?= $skip $plain $skip $plain ) # at least 2 plain lines
844+
$close ([0-9A-F]+) (?:$suffix)? \n # 1st line pins the VM address
845+
(?: $close \1 (?:$suffix)? \n )* # later lines: same address
846+
\z
847+
/x;
848+
}
852849
--- no_error_log
853850
[error]
854851
start privileged agent process
@@ -878,24 +875,23 @@ start privileged agent process
878875
GET /t
879876
--- grep_error_log eval: qr/lua close the global Lua VM \S+ in the cache helper process \d+|lua close the global Lua VM \S+$/
880877
--- grep_error_log_out eval
881-
qr/\A(?:lua close the global Lua VM ([0-9A-F]+) in the cache helper process \d+
882-
lua close the global Lua VM \1
883-
lua close the global Lua VM \1 in the cache helper process \d+
884-
lua close the global Lua VM \1
885-
|lua close the global Lua VM ([0-9A-F]+) in the cache helper process \d+
886-
lua close the global Lua VM \2 in the cache helper process \d+
887-
lua close the global Lua VM \2
888-
lua close the global Lua VM \2
889-
|lua close the global Lua VM ([0-9A-F]+)
890-
lua close the global Lua VM \3 in the cache helper process \d+
891-
lua close the global Lua VM \3
892-
lua close the global Lua VM \3 in the cache helper process \d+
893-
|lua close the global Lua VM ([0-9A-F]+)
894-
lua close the global Lua VM \4 in the cache helper process \d+
895-
lua close the global Lua VM \4 in the cache helper process \d+
896-
lua close the global Lua VM \4
897-
)(?:lua close the global Lua VM [0-9A-F]+
898-
)*\z/
878+
do {
879+
my $close = qr/lua close the global Lua VM /;
880+
my $helper = qr/${close}[0-9A-F]+ in the cache helper process \d+\n/;
881+
my $plain = qr/${close}[0-9A-F]+\n/;
882+
my $suffix = qr/ in the cache helper process \d+/;
883+
my $skip = qr/(?:[^\n]*\n)*?/;
884+
885+
qr/
886+
\A
887+
(?= $skip $helper $skip $helper ) # at least 2 helper lines
888+
(?! $skip $helper $skip $helper $skip $helper ) # but not a 3rd one
889+
(?= $skip $plain $skip $plain ) # at least 2 plain lines
890+
$close ([0-9A-F]+) (?:$suffix)? \n # 1st line pins the VM address
891+
(?: $close \1 (?:$suffix)? \n )* # later lines: same address
892+
\z
893+
/x;
894+
}
899895
--- error_log eval
900896
qr/start privileged agent process \d+/
901897
--- no_error_log

‎t/128-duplex-tcp-socket.t‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ F(ngx_http_lua_socket_tcp_finalize_write_part) {
355355
--- tcp_query_len: 11
356356
--- no_error_log
357357
[error]
358-
--- wait: 0.05
358+
--- wait: 0.5
359359

360360

361361

‎t/189-http2-subreq-error-wakeup.t‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ __DATA__
4646
--- http2
4747
--- request
4848
GET /delay
49+
--- curl_options: --max-time=0.9
4950
--- timeout: 1
5051
--- abort
5152
--- ignore_response
@@ -100,6 +101,7 @@ Parent request finished, got response from subrequest
100101
--- http2
101102
--- request
102103
GET /outer
104+
--- curl_options: --max-time=0.9
103105
--- timeout: 1
104106
--- abort
105107
--- ignore_response
@@ -160,6 +162,7 @@ Outer request completed
160162
--- http2
161163
--- request
162164
GET /parallel
165+
--- curl_options: --max-time=0.9
163166
--- timeout: 1
164167
--- abort
165168
--- ignore_response

0 commit comments

Comments
 (0)