Skip to content

Commit bf14723

Browse files
committed
tests: fixed a test case that might fail due to timing errors.
1 parent 0c8df2f commit bf14723

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/106-timer.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ qr/\[lua\] content_by_lua\(nginx\.conf:\d+\):\d+: elapsed: 0\.0(?:4[4-9]|5[0-6])
174174
local begin = ngx.now()
175175
local function f()
176176
print("my lua timer handler")
177-
ngx.sleep(0.02)
177+
ngx.sleep(0.2)
178178
print("elapsed: ", ngx.now() - begin)
179179
end
180180
local ok, err = ngx.timer.at(0.05, f)
@@ -199,7 +199,7 @@ delete thread 2
199199
--- response_body
200200
registered timer
201201

202-
--- wait: 0.12
202+
--- wait: 0.3
203203
--- no_error_log
204204
[error]
205205
[alert]
@@ -208,7 +208,7 @@ registered timer
208208
--- error_log eval
209209
[
210210
qr/\[lua\] .*? my lua timer handler/,
211-
qr/\[lua\] content_by_lua\(nginx\.conf:\d+\):\d+: elapsed: 0\.0(?:6[4-9]|7[0-6])/,
211+
qr/\[lua\] content_by_lua\(nginx\.conf:\d+\):\d+: elapsed: 0\.(?:1[4-9]|2[0-6]?)/,
212212
"lua ngx.timer expired",
213213
"http lua close fake http connection"
214214
]

0 commit comments

Comments
 (0)