2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-26 14:56:29 +00:00

backend: try to cleanup test leftovers

This commit is contained in:
Michael Eischer 2021-01-29 22:52:26 +01:00
parent f740b2fb23
commit e0867c9682

View File

@ -577,13 +577,15 @@ func (s *Suite) TestSaveError(t *testing.T) {
}() }()
length := rand.Intn(1<<23) + 200000 length := rand.Intn(1<<23) + 200000
data := test.Random(23, length) data := test.Random(24, length)
var id restic.ID var id restic.ID
copy(id[:], data) copy(id[:], data)
// test that incomplete uploads fail // test that incomplete uploads fail
h := restic.Handle{Type: restic.PackFile, Name: id.String()} h := restic.Handle{Type: restic.PackFile, Name: id.String()}
err := b.Save(context.TODO(), h, &incompleteByteReader{ByteReader: *restic.NewByteReader(data)}) err := b.Save(context.TODO(), h, &incompleteByteReader{ByteReader: *restic.NewByteReader(data)})
// try to delete possible leftovers
_ = s.delayedRemove(t, b, h)
if err == nil { if err == nil {
t.Fatal("incomplete upload did not fail") t.Fatal("incomplete upload did not fail")
} }