File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 20
20
from supervisor .tests .base import DummyProcessGroup
21
21
from supervisor .tests .base import DummyFCGIProcessGroup
22
22
23
- from supervisor .process import Subprocess
23
+ from supervisor .process import Subprocess , ProcessStates
24
24
from supervisor .options import BadCommand
25
25
26
26
class SubprocessTests (unittest .TestCase ):
@@ -1799,6 +1799,14 @@ def test_before_spawn_gets_socket_ref(self):
1799
1799
instance .before_spawn ()
1800
1800
self .assertFalse (instance .fcgi_sock is None )
1801
1801
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
+
1802
1810
def test_after_finish_removes_socket_ref (self ):
1803
1811
options = DummyOptions ()
1804
1812
config = DummyPConfig (options , 'good' , '/good/filename' , uid = 1 )
You can’t perform that action at this time.
0 commit comments