Skip to content

Commit aa6ac0a

Browse files
committed
test that Queues can be dynamically added/removed
without restarting a worker when using '*'
1 parent 6951307 commit aa6ac0a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/worker_test.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,24 @@ def self.exception
163163
assert_equal %w( jobs high critical blahblah ).sort, processed_queues
164164
end
165165

166+
it "can work with dynamically added queues when using wildcard" do
167+
worker = Resque::Worker.new("*")
168+
169+
assert_equal ["jobs"], Resque.queues
170+
171+
Resque::Job.create(:high, GoodJob)
172+
Resque::Job.create(:critical, GoodJob)
173+
Resque::Job.create(:blahblah, GoodJob)
174+
175+
processed_queues = []
176+
177+
worker.work(0) do |job|
178+
processed_queues << job.queue
179+
end
180+
181+
assert_equal %w( jobs high critical blahblah ).sort, processed_queues
182+
end
183+
166184
it "has a unique id" do
167185
assert_equal "#{`hostname`.chomp}:#{$$}:jobs", @worker.to_s
168186
end

0 commit comments

Comments
 (0)