Skip to content

Commit 412f8d7

Browse files
author
cod1k
committed
TESTS: Supervisord crushes on exceptions while adding process-group
1 parent a7cb60d commit 412f8d7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

supervisor/tests/test_supervisord.py

+16
Original file line numberDiff line numberDiff line change
@@ -834,3 +834,19 @@ def callback(event):
834834
self.assertEqual(supervisord.ticks[3600], 3600)
835835
self.assertEqual(len(L), 6)
836836
self.assertEqual(L[-1].__class__, events.Tick3600Event)
837+
838+
def test_add_failing_process_group_wont_crush(self):
839+
options = DummyOptions()
840+
supervisord = self._makeOne(options)
841+
842+
pconfig = DummyPConfig(options, 'process1', '/bin/foo', '/tmp')
843+
group = DummyPGroupConfig(options, 'group1', pconfigs=[pconfig])
844+
def throw():
845+
raise Exception()
846+
group.make_group = throw
847+
848+
# set up supervisord with an active configuration of group1 and group2
849+
supervisord.options.process_group_configs = [group]
850+
self.assertFalse(supervisord.add_process_group(group))
851+
self.assertTrue(not supervisord.process_groups)
852+
self.assertTrue(str(options.logger.data[0]).startswith('Unable to add group'))

0 commit comments

Comments
 (0)