1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-01-03 05:35:58 +00:00

Merge pull request #5204 from ThomasWaldmann/fix-sporadic-test_delete_force-failure-master

test_delete_force: avoid sporadic test setup issues, fixes #5196
This commit is contained in:
TW 2020-06-01 17:58:05 +02:00 committed by GitHub
commit 47b1c47459
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1489,11 +1489,12 @@ def test_delete_force(self):
manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK)
archive = Archive(repository, key, manifest, 'test') archive = Archive(repository, key, manifest, 'test')
for item in archive.iter_items(): for item in archive.iter_items():
if 'chunks' in item: if item.path.endswith('testsuite/archiver.py'):
first_chunk_id = item.chunks[0].id repository.delete(item.chunks[-1].id)
repository.delete(first_chunk_id)
repository.commit(compact=False)
break break
else:
assert False # missed the file
repository.commit(compact=False)
output = self.cmd('delete', '--force', self.repository_location + '::test') output = self.cmd('delete', '--force', self.repository_location + '::test')
self.assert_in('deleted archive was corrupted', output) self.assert_in('deleted archive was corrupted', output)
self.cmd('check', '--repair', self.repository_location) self.cmd('check', '--repair', self.repository_location)