Skip to content

Commit ab3d9ab

Browse files
jherdmanrosa
authored andcommitted
Beef up some other supervisor tests
Asserting on the abort message ensures we're not aborting for some other reason.
1 parent 497e1fb commit ab3d9ab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/unit/supervisor_test.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ class SupervisorTest < ActiveSupport::TestCase
4141
end
4242

4343
test "start with empty configuration" do
44-
pid = run_supervisor_as_fork(workers: [], dispatchers: [])
44+
pid, _out, err = run_supervisor_as_fork_with_captured_io(workers: [], dispatchers: [])
4545
sleep(0.5)
4646
assert_no_registered_processes
4747

4848
assert_not process_exists?(pid)
49+
assert_match %r{No workers or processed configured. Exiting...}, err
4950
end
5051

5152
test "start with invalid configuration" do
@@ -76,11 +77,12 @@ class SupervisorTest < ActiveSupport::TestCase
7677
FileUtils.mkdir_p(File.dirname(@pidfile))
7778
File.write(@pidfile, ::Process.pid.to_s)
7879

79-
pid = run_supervisor_as_fork
80+
pid, _out, err = run_supervisor_as_fork_with_captured_io
8081
wait_for_registered_processes(4)
8182

8283
assert File.exist?(@pidfile)
8384
assert_not_equal pid, File.read(@pidfile).strip.to_i
85+
assert_match %r{A Solid Queue supervisor is already running}, err
8486

8587
wait_for_process_termination_with_timeout(pid, exitstatus: 1)
8688
end

0 commit comments

Comments
 (0)