mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 13:06:56 +08:00
BUGFIX: work correctly if process forks
This commit is contained in:
@ -23,6 +23,26 @@ describe Scheduler::Defer do
|
||||
@defer.stop!
|
||||
end
|
||||
|
||||
it "recovers from a crash / fork" do
|
||||
s = nil
|
||||
@defer.stop!
|
||||
wait_for(10) do
|
||||
@defer.stopped?
|
||||
end
|
||||
# hack allow thread to die
|
||||
sleep 0.005
|
||||
|
||||
@defer.later do
|
||||
s = "good"
|
||||
end
|
||||
|
||||
wait_for(10) do
|
||||
s == "good"
|
||||
end
|
||||
|
||||
s.should == "good"
|
||||
end
|
||||
|
||||
it "can queue jobs properly" do
|
||||
s = nil
|
||||
|
||||
|
Reference in New Issue
Block a user