Skip to content

Commit

Permalink
TESTS: Supervisord crushes on exceptions while adding process-group
Browse files Browse the repository at this point in the history
  • Loading branch information
cod1k committed Jan 27, 2023
1 parent a7cb60d commit 412f8d7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions supervisor/tests/test_supervisord.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,3 +834,19 @@ def callback(event):
self.assertEqual(supervisord.ticks[3600], 3600)
self.assertEqual(len(L), 6)
self.assertEqual(L[-1].__class__, events.Tick3600Event)

def test_add_failing_process_group_wont_crush(self):
options = DummyOptions()
supervisord = self._makeOne(options)

pconfig = DummyPConfig(options, 'process1', '/bin/foo', '/tmp')
group = DummyPGroupConfig(options, 'group1', pconfigs=[pconfig])
def throw():
raise Exception()
group.make_group = throw

# set up supervisord with an active configuration of group1 and group2
supervisord.options.process_group_configs = [group]
self.assertFalse(supervisord.add_process_group(group))
self.assertTrue(not supervisord.process_groups)
self.assertTrue(str(options.logger.data[0]).startswith('Unable to add group'))

0 comments on commit 412f8d7

Please sign in to comment.