Hello!
On Wed, Jan 27, 2016 at 7:23 PM, Thijs Schreijer wrote:
>
> Ok. So basically nothing I can do about that at the moment. I'll document the one test marked as "--- SKIP", referring to this issue for now.
>
Sorry, I forgot again to mention that there exists a work-around for
this which I used in ngx_lua's test suite already. Consider the
following test file:
use Test::Nginx::Socket::Lua 'no_plan';
repeat_each(2);
master_on();
run_tests();
__DATA__
=== TEST 1: timer premature expiry
--- http_config
init_worker_by_lua_block {
local function f(premature)
print("timer fired: premature: ", premature)
end
local ok, err = ngx.timer.at(3600, f)
if not ok then
error("failed to create timer: ", err)
end
print("created a timer")
}
--- config
location = /t {
content_by_lua_block {
f = assert(io.open("t/servroot/logs/nginx.pid"))
local pid = assert(tonumber(f:read()), "read pid")
f:close()
local cmd = "kill -HUP " .. pid
assert(os.execute(cmd))
}
}
--- request
GET /t
--- error_log
created a timer
timer fired: premature: true
--- response_body
--- no_error_log
[error]
--- wait: 0.2
It passes successfully on my side :)
Best regards,
-agentzh