From ab6df1280fd0904a2eecc895c3d047d5dd1547b9 Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Sat, 26 Jun 2021 14:50:40 +0200 Subject: [PATCH] bug(github_actions): Skip unreliable test Signed-off-by: Lucas Schwiderski --- tests/test-leak-client.lua | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/tests/test-leak-client.lua b/tests/test-leak-client.lua index e81c5391..89e86558 100644 --- a/tests/test-leak-client.lua +++ b/tests/test-leak-client.lua @@ -4,6 +4,18 @@ local awful = require("awful") local wibox = require("wibox") local gtable = require("gears.table") +-- This test has been proven to perform unreliably on GitHub Actions. +-- The additional Lua process that creates the test client will sometimes +-- linger for an unpredictable amount of time. +-- Stalling the step to check for clean-up increases the chance for success, +-- but does not fix the issue. +-- See https://github.com/awesomeWM/awesome/pull/3292. +if os.getenv("GITHUB_ACTIONS") then + print("Skipping unreliable test 'test-leak-client'") + runner.run_steps { function() return true end } + return +end + -- Create a titlebar and return a table with references to its member widgets. local function create_titlebar(c) local parts = {} @@ -88,20 +100,9 @@ local steps = { assert(not success, msg) assert(msg:find("invalid object"), msg) - -- 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 - + -- Check that it is garbage-collectable + collectgarbage("collect") assert(#objs == 0, "still clients left after garbage collect") - if tries > 0 then - print("Took approx. " .. tries .. " seconds to clean leaked client") - end - return true end end,