@@ -1004,6 +1004,29 @@ def test_signal_from_running(self):
1004
1004
self .assertTrue (instance .pid in options .kills )
1005
1005
self .assertEqual (options .kills [instance .pid ], signal .SIGWINCH )
1006
1006
1007
+ def test_signal_from_running_error_ESRCH (self ):
1008
+ options = DummyOptions ()
1009
+ config = DummyPConfig (options , 'test' , '/test' )
1010
+ options .kill_exception = OSError (errno .ESRCH ,
1011
+ os .strerror (errno .ESRCH ))
1012
+ instance = self ._makeOne (config )
1013
+ L = []
1014
+ from supervisor .states import ProcessStates
1015
+ from supervisor import events
1016
+ events .subscribe (events .ProcessStateEvent , lambda x : L .append (x ))
1017
+ instance .pid = 11
1018
+ instance .state = ProcessStates .RUNNING
1019
+ instance .signal (signal .SIGWINCH )
1020
+ self .assertEqual (options .logger .data [0 ],
1021
+ 'sending test (pid 11) sig SIGWINCH' )
1022
+ self .assertEqual (options .logger .data [1 ], 'unable to signal test (pid 11), '
1023
+ 'it probably just now exited on its own: %s' %
1024
+ str (options .kill_exception ))
1025
+ self .assertFalse (instance .killing )
1026
+ self .assertEqual (instance .state , ProcessStates .RUNNING ) # unchanged
1027
+ self .assertEqual (instance .pid , 11 ) # unchanged
1028
+ self .assertEqual (len (L ), 0 )
1029
+
1007
1030
def test_signal_from_running_error (self ):
1008
1031
options = DummyOptions ()
1009
1032
config = DummyPConfig (options , 'test' , '/test' )
0 commit comments