'If the alias child process does not exit within a particular period of
time, the L{Deferred} returned by L{MessageWrapper.eomReceived} should
fail with L{ProcessAliasTimeout} and send the I{KILL} signal to the
child process..'

def test_processAliasTimeout(self):

    reactor = task.Clock()
    transport = StubProcess()
    proto = mail.alias.ProcessAliasProtocol()
    proto.makeConnection(transport)
    receiver = mail.alias.MessageWrapper(proto, None, reactor)
    d = receiver.eomReceived()
    reactor.advance(receiver.completionTimeout)
    def timedOut(ignored):
        self.assertEqual(transport.signals, ['KILL'])
        proto.processEnded(ProcessTerminated(self.signalStatus(signal.SIGKILL)))
    self.assertFailure(d, mail.alias.ProcessAliasTimeout)
    d.addCallback(timedOut)
    return d
