From df2b3fe7933299edb77cc3e4b9cdb8abd9f8308e Mon Sep 17 00:00:00 2001 From: Tom de Bruijn Date: Mon, 11 Nov 2024 09:05:32 +0100 Subject: [PATCH] Add timeout to checkin scheduler spec There are times the spec runs for hours (6 hours on the CI) and that's very wasteful. If it's stuck after 5 minutes it's not getting unstuck so let's time it out. [skip review] [skip changeset] --- spec/lib/appsignal/check_in/scheduler_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/lib/appsignal/check_in/scheduler_spec.rb b/spec/lib/appsignal/check_in/scheduler_spec.rb index 096a401e..8046c2b2 100644 --- a/spec/lib/appsignal/check_in/scheduler_spec.rb +++ b/spec/lib/appsignal/check_in/scheduler_spec.rb @@ -23,6 +23,12 @@ end end + around do |example| + Timeout.timeout(5 * 60) do # in seconds + example.run + end + end + describe "when no event is sent" do it "does not start a thread" do expect(scheduler.thread).to be_nil