1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-25 09:18:55 +00:00

Merge pull request #4316 from MichaelEischer/fix-check-modified-data

Fix flaky TestCheckerModifiedData test
This commit is contained in:
Michael Eischer 2023-05-05 22:38:28 +02:00 committed by GitHub
commit fefe15d7a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 5 deletions

View file

@ -331,10 +331,6 @@ func (erd errorReadCloser) Read(p []byte) (int, error) {
// induceError flips a bit in the slice.
func induceError(data []byte) {
if rand.Float32() < 0.2 {
return
}
pos := rand.Intn(len(data))
data[pos] ^= 1
}

View file

@ -61,7 +61,7 @@ func LoadSnapshot(ctx context.Context, loader LoaderUnpacked, id ID) (*Snapshot,
sn := &Snapshot{id: &id}
err := LoadJSONUnpacked(ctx, loader, SnapshotFile, id, sn)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to load snapshot %v: %w", id.Str(), err)
}
return sn, nil