feat(github_actions): Improve test

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
This commit is contained in:
Lucas Schwiderski 2021-04-11 21:32:39 +02:00
parent 857b7199d6
commit d9711c3f48
No known key found for this signature in database
GPG Key ID: AA12679AAA6DF4D8
1 changed files with 2 additions and 4 deletions

View File

@ -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,