Skip to content

Allow supervisor to recover after crash #519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix intermittently failing test
darinwilson committed Feb 20, 2025
commit ae1f0033a8275c1c40e7784d320064dcbe0845fe
6 changes: 2 additions & 4 deletions test/unit/supervisor_test.rb
Original file line number Diff line number Diff line change
@@ -156,18 +156,16 @@ class SupervisorTest < ActiveSupport::TestCase
end

test "attempt to restart supervisor if it fails unexpectedly" do
SolidQueue.max_restart_attempts = 2
SolidQueue.stubs(:max_restart_attempts).returns(2)
SolidQueue::Supervisor.any_instance.expects(:start).raises(StandardError).times(SolidQueue.max_restart_attempts + 1)
SolidQueue::LogSubscriber.any_instance.expects(:supervisor_restart).times(SolidQueue.max_restart_attempts)
assert_raises StandardError do
SolidQueue::Supervisor.start
end
end

test "skip restart attempt if configured not to" do
SolidQueue.max_restart_attempts = 0
SolidQueue.stubs(:max_restart_attempts).returns(0)
SolidQueue::Supervisor.any_instance.expects(:start).raises(StandardError).times(1)
SolidQueue::LogSubscriber.any_instance.expects(:supervisor_restart).times(0)
assert_raises StandardError do
SolidQueue::Supervisor.start
end