'If the result of a request is an error response, the Deferreds for all
concurrently issued requests associated with that result fire with the
L{Failure}.'

def test_multipleConcurrentFailure(self):

    protocol = StubDNSDatagramProtocol()
    resolver = client.Resolver(servers=[('example.com', 53)])
    resolver._connectedProtocol = (lambda : protocol)
    queries = protocol.queries
    query = dns.Query('foo.example.com', dns.A)
    firstResult = resolver.query(query)
    secondResult = resolver.query(query)
    class ExpectedException(Exception, ):
        pass
    queries.pop()[(-1)].errback(failure.Failure(ExpectedException()))
    return defer.gatherResults([self.assertFailure(firstResult, ExpectedException), self.assertFailure(secondResult, ExpectedException)])
