File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 2020from supervisor .tests .base import DummyProcessGroup
2121from supervisor .tests .base import DummyFCGIProcessGroup
2222
23- from supervisor .process import Subprocess
23+ from supervisor .process import Subprocess , ProcessStates
2424from supervisor .options import BadCommand
2525
2626class SubprocessTests (unittest .TestCase ):
@@ -1799,6 +1799,14 @@ def test_before_spawn_gets_socket_ref(self):
17991799 instance .before_spawn ()
18001800 self .assertFalse (instance .fcgi_sock is None )
18011801
1802+ def test_before_spawn_failure_sets_fatal_state (self ):
1803+ options = DummyOptions ()
1804+ config = DummyPConfig (options , 'good' , '/good/filename' , uid = 1 )
1805+ instance = self ._makeOne (config )
1806+ self .assertEqual (instance .state , ProcessStates .STOPPED )
1807+ instance .spawn ()
1808+ self .assertEqual (instance .state , ProcessStates .FATAL )
1809+
18021810 def test_after_finish_removes_socket_ref (self ):
18031811 options = DummyOptions ()
18041812 config = DummyPConfig (options , 'good' , '/good/filename' , uid = 1 )
You can’t perform that action at this time.
0 commit comments