ingress-nginx-helm/rootfs/etc/nginx/lua/test/lua_ingress_test.lua

10 lines
345 B
Lua
Raw Normal View History

2018-12-19 13:46:53 +00:00
describe("lua_ingress", function()
it("patches math.randomseed to not be called more than once per worker", function()
local s = spy.on(ngx, "log")
2019-01-18 02:08:33 +00:00
math.randomseed()
2018-12-19 13:46:53 +00:00
assert.spy(s).was_called_with(ngx.WARN,
2019-01-18 02:08:33 +00:00
string.format("ignoring math.randomseed() since PRNG is already seeded for worker %d", ngx.worker.pid()))
2018-12-19 13:46:53 +00:00
end)
end)