Skip to content

Commit 70ae9d0

Browse files
committed
test that nonblocking pop on MultiQueue doesn't block
1 parent aa6ac0a commit 70ae9d0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/multi_queue_test.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@
3131
assert_equal [bar, job], queue.pop(true)
3232
end
3333

34+
it "nonblocking pop doesn't block" do
35+
foo = Resque::Queue.new 'foo', redis, coder
36+
bar = Resque::Queue.new 'bar', redis, coder
37+
queue = Resque::MultiQueue.new([foo, bar], redis)
38+
39+
assert_raises ThreadError do
40+
queue.pop(true)
41+
end
42+
end
43+
3444
it "blocks forever on pop" do
3545
foo = Resque::Queue.new 'foo', redis, coder
3646
bar = Resque::Queue.new 'bar', redis, coder

0 commit comments

Comments
 (0)