probe: Add test for syncing a delete when the remote 404s

This works fine; we continue processing the other rows in the DB. But it
*does* take longer than it really ought to require. See the related bug;
we ought to be able to shave some 17s off the test time by not retrying
on the 404.

Change-Id: I9ca2511651e9b2bc0045894baa4062d20bc15369
Related-Bug: #1849841
This commit is contained in:
Tim Burke 2019-10-25 21:56:01 -07:00
parent 68924d920c
commit 73a0e8e9cf

View File

@ -383,6 +383,30 @@ class TestContainerSync(BaseTestContainerSync):
dest_container, object_name)
self.assertEqual(body, b'new-test-body')
def test_sync_delete_when_object_never_synced(self):
source_container, dest_container = self._setup_synced_containers()
# create a tombstone row
object_name = 'object-%s' % uuid.uuid4()
client.put_object(self.url, self.token, source_container,
object_name, 'source-body')
client.delete_object(self.url, self.token, source_container,
object_name)
# upload some other name, too
object_name = 'object-%s' % uuid.uuid4()
client.put_object(self.url, self.token, source_container, object_name,
'other-source-body')
# cycle container-sync
Manager(['container-sync']).once()
# verify that the deletes (which 404ed) didn't block
# that last row from syncing
resp_headers, body = client.get_object(self.url, self.token,
dest_container, object_name)
self.assertEqual(body, b'other-source-body')
class TestContainerSyncAndSymlink(BaseTestContainerSync):