@@ -1004,6 +1004,29 @@ def test_signal_from_running(self):
10041004 self .assertTrue (instance .pid in options .kills )
10051005 self .assertEqual (options .kills [instance .pid ], signal .SIGWINCH )
10061006
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+
10071030 def test_signal_from_running_error (self ):
10081031 options = DummyOptions ()
10091032 config = DummyPConfig (options , 'test' , '/test' )
0 commit comments