feat(github_actions): Improve test
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
This commit is contained in:
parent
857b7199d6
commit
d9711c3f48
|
@ -88,22 +88,20 @@ local steps = {
|
||||||
assert(not success, msg)
|
assert(not success, msg)
|
||||||
assert(msg:find("invalid object"), msg)
|
assert(msg:find("invalid object"), msg)
|
||||||
|
|
||||||
-- Check that it is garbage-collectable
|
|
||||||
collectgarbage("collect")
|
|
||||||
|
|
||||||
-- On GitHub Actions, it can take a while for clients to be killed
|
-- On GitHub Actions, it can take a while for clients to be killed
|
||||||
-- properly.
|
-- properly.
|
||||||
local tries = 0
|
local tries = 0
|
||||||
while (#objs > 0 and tries < 60) do
|
while (#objs > 0 and tries < 60) do
|
||||||
|
collectgarbage("collect")
|
||||||
os.execute("sleep 1")
|
os.execute("sleep 1")
|
||||||
tries = tries + 1
|
tries = tries + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
assert(#objs == 0, "still clients left after garbage collect")
|
||||||
if tries > 0 then
|
if tries > 0 then
|
||||||
print("Took approx. " .. tries .. " seconds to clean leaked client")
|
print("Took approx. " .. tries .. " seconds to clean leaked client")
|
||||||
end
|
end
|
||||||
|
|
||||||
assert(#objs == 0, "still clients left after garbage collect")
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Reference in New Issue