File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -834,3 +834,21 @@ 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+ from unittest import mock
843+
844+ group = mock .Mock ()
845+
846+ make_group = mock .Mock (side_effect = Exception )
847+
848+ group .attach_mock (make_group , 'make_group' )
849+
850+ # set up supervisord with an active configuration of group1 and group2
851+ supervisord .options .process_group_configs = [group ]
852+ self .assertFalse (supervisord .add_process_group (group ))
853+ self .assertTrue (not supervisord .process_groups )
854+ self .assertTrue (str (options .logger .data [0 ]).startswith ('Unable to add group' ))
You can’t perform that action at this time.
0 commit comments