'L{ProcessMonitor.stopService} should cancel any scheduled process
restarts.'

def test_stopServiceCancelRestarts(self):

    self.pm.addProcess('foo', ['foo'])
    self.pm.startService()
    self.reactor.advance(self.pm.threshold)
    self.assertIn('foo', self.pm.protocols)
    self.reactor.advance(1)
    self.pm.protocols['foo'].processEnded(Failure(ProcessDone(0)))
    self.assertTrue(self.pm.restart['foo'].active())
    self.pm.stopService()
    self.assertFalse(self.pm.restart['foo'].active())
