From 86aa7138f4b63b59c37a1d771d1ea641267a64f4 Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Tue, 10 Dec 2024 12:01:02 -0800 Subject: [PATCH] tests(*): continue exit event callbacks after timer.shutdown() --- spec/busted-ci-helper.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/busted-ci-helper.lua b/spec/busted-ci-helper.lua index 59d73ee81151..2260138b890d 100644 --- a/spec/busted-ci-helper.lua +++ b/spec/busted-ci-helper.lua @@ -6,7 +6,13 @@ do assert(type(shutdown_timers) == "function") -- shutdown lua-resty-timer-ng to allow the nginx worker to stop quickly - busted.subscribe({ 'exit' }, shutdown_timers) + busted.subscribe({ 'exit' }, function() + shutdown_timers() + + -- second return value must be `true`, or else all other callbacks for this + -- event will be skipped + return nil, true + end) end local BUSTED_EVENT_PATH = os.getenv("BUSTED_EVENT_PATH")