|
@@ -887,12 +887,32 @@ class SubprocessTests(unittest.TestCase):
|
|
|
|
|
|
instance.signal(signal.SIGWINCH )
|
|
|
|
|
|
- self.assertEqual(options.logger.data[0], "attempted to send test sig SIGWINCH "
|
|
|
+ self.assertEqual(options.logger.data[0], "attempted to send test sig SIGWINCH "
|
|
|
"but it wasn't running")
|
|
|
|
|
|
self.assertEqual(killedpid, [])
|
|
|
-
|
|
|
|
|
|
+ def test_signal_error(self):
|
|
|
+ options = DummyOptions()
|
|
|
+ config = DummyPConfig(options, 'test', '/test')
|
|
|
+ options.kill_error = 1
|
|
|
+ instance = self._makeOne(config)
|
|
|
+ L = []
|
|
|
+ from supervisor.states import ProcessStates
|
|
|
+ from supervisor import events
|
|
|
+ events.subscribe(events.ProcessStateEvent,
|
|
|
+ lambda x: L.append(x))
|
|
|
+ instance.pid = 11
|
|
|
+ instance.state = ProcessStates.RUNNING
|
|
|
+ instance.signal(signal.SIGWINCH)
|
|
|
+ self.assertEqual(options.logger.data[0],
|
|
|
+ 'sending test (pid 11) sig SIGWINCH')
|
|
|
+ self.assertTrue(options.logger.data[1].startswith(
|
|
|
+ 'unknown problem sending sig test (11)'))
|
|
|
+ self.assertEqual(instance.killing, 0)
|
|
|
+ self.assertEqual(len(L), 1)
|
|
|
+ event = L[0]
|
|
|
+ self.assertEqual(event.__class__, events.ProcessStateUnknownEvent)
|
|
|
|
|
|
def test_finish(self):
|
|
|
options = DummyOptions()
|