Beispiel #1
0
    def setUp(self):
        self._mock_datastore = MagicMock()
        self._query = query_pb2.Query()
        self._query.kind.add().name = 'dummy_kind'
        patch_retry(self, helper)
        self._retriable_errors = [
            RPCError("dummy", code_pb2.INTERNAL, "failed"),
            SocketError(errno.ECONNRESET, "Connection Reset"),
            SocketError(errno.ETIMEDOUT, "Timed out")
        ]

        self._non_retriable_errors = [
            RPCError("dummy", code_pb2.UNAUTHENTICATED, "failed"),
            SocketError(errno.EADDRNOTAVAIL, "Address not available")
        ]
Beispiel #2
0
 def permanent_retriable_datastore_failure(self, req):
     raise RPCError("dummy", code_pb2.UNAVAILABLE, "failed")
Beispiel #3
0
 def non_retriable_datastore_failure(self, req):
   raise RPCError("dummy", code_pb2.UNAUTHENTICATED, "failed")
Beispiel #4
0
 def transient_retriable_datastore_failure(self, req):
   if self._transient_fail_count:
     self._transient_fail_count -= 1
     raise RPCError("dummy", code_pb2.INTERNAL, "failed")
   else:
     return datastore_pb2.RunQueryResponse()
 def transient_datastore_failure(self, req):
     if self._transient_fail_count:
         self._transient_fail_count -= 1
         raise RPCError("dummy", 500, "failed")
     else:
         return datastore_pb2.RunQueryResponse()
 def permanent_datastore_failure(self, req):
     raise RPCError("dummy", 500, "failed")