def finalize(self, ctx, shard_state):
    retry_count = RetryCount.get_by_key_name(__name__)
    if not retry_count:
      retry_count = RetryCount(key_name=__name__, retries=0)
    if retry_count.retries < self.RETRIES:
      retry_count.retries += 1
      retry_count.put()
      raise cloudstorage.TransientError("output writer finalize failed.")
    super(TestFileRecordsOutputWriter, self).finalize(ctx, shard_state)
Simulate output writer finalization Error.
dataset/ETHPy150Open GoogleCloudPlatform/appengine-mapreduce/python/test/mapreduce/mapreduce_pipeline_test.py/TestFileRecordsOutputWriter.finalize