Skip to content

Commit

Permalink
added rspec to check that shutdow_and_exit messages removed from queu…
Browse files Browse the repository at this point in the history
…e when server started
  • Loading branch information
yrudman committed May 1, 2018
1 parent 87cbb0c commit 3fc7ffc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/models/miq_server/at_startup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
msg.reload
expect(msg.state).to eq(MiqQueue::STATE_ERROR)
end

it "deletes shutdown_and_exit messages" do
worker = FactoryGirl.create(:miq_ems_refresh_worker, :miq_server_id => @miq_server.id)
FactoryGirl.create(:miq_queue, :state => MiqQueue::STATE_DEQUEUE, :handler => worker,
:method_name => "shutdown_and_exit")
described_class.clean_dequeued_messages
expect(MiqQueue.count).to eq 0
end
end

context "where worker on other server has a message in dequeue" do
Expand Down

0 comments on commit 3fc7ffc

Please sign in to comment.