'Tests resumable upload that fails completely in one process,
then when restarted completes, using a tracker file'

def test_multiple_in_process_failures_then_succeed_with_tracker_file(self):

    harness = CallbackTestHarness(fail_after_n_bytes=(LARGE_KEY_SIZE / 2), num_times_to_fail=2)
    tracker_file_name = self.make_tracker_file()
    res_upload_handler = ResumableUploadHandler(tracker_file_name=tracker_file_name, num_retries=1)
    (larger_src_file_as_string, larger_src_file) = self.make_large_file()
    larger_src_file.seek(0)
    dst_key = self._MakeKey(set_contents=False)
    try:
        dst_key.set_contents_from_file(larger_src_file, cb=harness.call, res_upload_handler=res_upload_handler)
        self.fail('Did    not    get    expected    ResumableUploadException')
    except ResumableUploadException as e:
        self.assertEqual(e.disposition, ResumableTransferDisposition.ABORT_CUR_PROCESS)
        self.assertTrue(os.path.exists(tracker_file_name))
    larger_src_file.seek(0)
    dst_key.set_contents_from_file(larger_src_file, cb=harness.call, res_upload_handler=res_upload_handler)
    self.assertEqual(LARGE_KEY_SIZE, dst_key.size)
    self.assertEqual(larger_src_file_as_string, dst_key.get_contents_as_string())
    self.assertFalse(os.path.exists(tracker_file_name))
    self.assertTrue(((len(harness.transferred_seq_before_first_failure) > 1) and (len(harness.transferred_seq_after_first_failure) > 1)))
