From d9711c3f48c4ce1e1235838b9150a4fdab910b3f Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Sun, 11 Apr 2021 21:32:39 +0200 Subject: [PATCH] feat(github_actions): Improve test Signed-off-by: Lucas Schwiderski --- tests/test-leak-client.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/test-leak-client.lua b/tests/test-leak-client.lua index 9f326750..e81c5391 100644 --- a/tests/test-leak-client.lua +++ b/tests/test-leak-client.lua @@ -88,22 +88,20 @@ local steps = { assert(not success, 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 -- properly. local tries = 0 while (#objs > 0 and tries < 60) do + collectgarbage("collect") os.execute("sleep 1") tries = tries + 1 end + assert(#objs == 0, "still clients left after garbage collect") if tries > 0 then print("Took approx. " .. tries .. " seconds to clean leaked client") end - assert(#objs == 0, "still clients left after garbage collect") return true end end,