def _cancelConnectFailedTimeoutTest(self, connect):
        reactor = MemoryReactorClock()
        cc = ClientCreator(reactor, Protocol)
        d, factory = connect(reactor, cc)
        connector = reactor.connectors.pop()
        factory.clientConnectionFailed(
            connector, Failure(Exception("Simulated failure")))

        # Sanity check - there is an outstanding delayed call to fire the
        # Deferred.
        self.assertEqual(len(reactor.getDelayedCalls()), 1)

        # Cancel the Deferred, cancelling the delayed call.
        d.cancel()

        self.assertEqual(reactor.getDelayedCalls(), [])

        return self.assertFailure(d, CancelledError)
Starts up and runs web application server and salt api server
dataset/ETHPy150Open twisted/twisted/twisted/internet/test/test_protocol.py/ClientCreatorTests._cancelConnectFailedTimeoutTest--crossover with--dataset/ETHPy150Open saltstack/halite/halite/server_bottle.py/startServer