'When two requests are sent, a timeout call remains around for the
second request, and its timeout time is correct.'

def test_timeoutPipelining(self):

    d1 = self.proto.get('foo')
    d2 = self.proto.get('bar')
    d3 = Deferred()
    self.proto.connectionLost = d3.callback
    self.clock.advance((self.proto.persistentTimeOut - 1))
    self.proto.dataReceived('VALUE    foo    0    3\r\nbar\r\nEND\r\n')
    def check(result):
        self.assertEqual(result, (0, 'bar'))
        self.assertEqual(len(self.clock.calls), 1)
        for i in range(self.proto.persistentTimeOut):
            self.clock.advance(1)
        return self.assertFailure(d2, TimeoutError).addCallback(checkTime)
    def checkTime(ignored):
        self.assertEqual(self.clock.seconds(), ((2 * self.proto.persistentTimeOut) - 1))
    d1.addCallback(check)
    self.assertFailure(d3, ConnectionDone)
    return d1
