From 7a4e7ce04925a715835b467e903c3bc3a49fef49 Mon Sep 17 00:00:00 2001 From: fallwith Date: Mon, 25 Sep 2023 16:35:59 -0700 Subject: [PATCH] CI: fix flapping Sidekiq test The singleton instance of `Sidekiq::CLI` needs to have a Sidekiq configuration set on it for certain operations to work. Previously we had been lucking out by having the `cli` test helper method be called prior to the `test_captures_sidekiq_internal_errors` test (which does not make use of the helper) being ran. To prevent flapping, have the test make use of the `cli` helper (which preps a CLI instance with a config) to make it always pass regardless of the run order. --- test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb b/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb index 4b3ded74ad..60d7179dd6 100644 --- a/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb +++ b/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb @@ -47,7 +47,7 @@ def test_captures_sidekiq_internal_errors exception = StandardError.new('bonk') noticed = [] NewRelic::Agent.stub :notice_error, proc { |e| noticed.push(e) } do - Sidekiq::CLI.instance.handle_exception(exception) + cli.handle_exception(exception) end assert_equal 1, noticed.size