From 73a0e8e9cf7d26e3a06d3b48164d345478de4161 Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Fri, 25 Oct 2019 21:56:01 -0700 Subject: [PATCH] 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 --- test/probe/test_container_sync.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/probe/test_container_sync.py b/test/probe/test_container_sync.py index f04941c444..ba4408bf39 100644 --- a/test/probe/test_container_sync.py +++ b/test/probe/test_container_sync.py @@ -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):