Skip to content

A platform for community discussion. Free, open, simple.

DEV: Make output more useful when test fails (MiniSchedulerLongRunningJobLogger) (#35293)

Alan Guo Xiang Tan23cc275fee8d
diff --git a/spec/lib/mini_scheduler_long_running_job_logger_spec.rb b/spec/lib/mini_scheduler_long_running_job_logger_spec.rb
index e18d5c2ac10..5c87db5003d 100644
--- a/spec/lib/mini_scheduler_long_running_job_logger_spec.rb
+++ b/spec/lib/mini_scheduler_long_running_job_logger_spec.rb
@@ -99,9 +99,7 @@ RSpec.describe MiniSchedulerLongRunningJobLogger do
wait_for { loops == 1 }
- expect(fake_logger.warnings.size).to eq(1)
-
- expect(fake_logger.warnings.first).to match(
+ expect(fake_logger.warnings.map { |warning| warning.split("\n").first }).to contain_exactly(
"Sidekiq scheduled job `DailyJob` has been running for more than 120 minutes",
)
ensure