Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions test/unit/dispatcher_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@ class DispatcherTest < ActiveSupport::TestCase

test "polling queries are logged" do
log = StringIO.new
polling_query = /SELECT .* FROM .solid_queue_scheduled_executions. WHERE/

with_active_record_logger(ActiveSupport::Logger.new(log)) do
with_polling(silence: false) do
rewind_io(log)
@dispatcher.start
sleep 0.5.second
wait_while_with_timeout(3.seconds) { !log.string.match?(polling_query) }
end
end

assert_match /SELECT .* FROM .solid_queue_scheduled_executions. WHERE/, log.string
assert_match polling_query, log.string
end

test "polling queries can be silenced" do
Expand Down
6 changes: 4 additions & 2 deletions test/unit/worker_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,16 @@ class WorkerTest < ActiveSupport::TestCase

test "polling queries are logged" do
log = StringIO.new
polling_query = /SELECT .* FROM .solid_queue_ready_executions. WHERE .solid_queue_ready_executions...queue_name./

with_active_record_logger(ActiveSupport::Logger.new(log)) do
with_polling(silence: false) do
@worker.start
sleep 0.2
wait_while_with_timeout(3.seconds) { !log.string.match?(polling_query) }
end
end

assert_match /SELECT .* FROM .solid_queue_ready_executions. WHERE .solid_queue_ready_executions...queue_name./, log.string
assert_match polling_query, log.string
end

test "polling queries can be silenced" do
Expand Down
Loading