Workaround: Make sure this spec can not hang our spec suite

This commit is contained in:
Sam 2014-08-19 17:44:20 +10:00
parent 65826ab3a6
commit 76e74f6a3b

View File

@ -3,9 +3,27 @@ require_dependency 'sidekiq/pausable'
describe Sidekiq do
it "can pause and unpause" do
Sidekiq.pause!
Sidekiq.paused?.should == true
Sidekiq.unpause!
Sidekiq.paused?.should == false
# Temporary work around
t = Thread.new do
Sidekiq.pause!
Sidekiq.paused?.should == true
Sidekiq.unpause!
Sidekiq.paused?.should == false
end
t2 = Thread.new do
sleep 5
t.kill
end
t.join
if t2.alive?
t2.kill
else
raise "Timed out running sidekiq pause test"
end
end
end