def test_retry_without_retry_on_reconnect(self):
"""
If C{retryOnReconnect} is C{False}, the L{RemoteObject} object won't
retry to perform requests which failed because the connection was
lost, however requests made after a reconnection will still succeed.
"""
self.client.factor = 0.01 # Try reconnecting very quickly
connector = reactor.connectUNIX(self.socket, self.client)
remote = yield self.client.getRemoteObject()
# Disconnect
deferred = Deferred()
self.client.notifyOnConnect(deferred.callback)
connector.disconnect()
yield self.assertFailure(remote.modt(), ConnectionDone)
# Wait for reconnection and peform another call
yield deferred
result = yield remote.method("john")
self.assertEqual(result, "John")
self.client.stopTrying()
connector.disconnect()
评论列表
文章目录