2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-22 10:58: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. // induceError flips a bit in the slice.
func induceError(data []byte) { func induceError(data []byte) {
if rand.Float32() < 0.2 {
return
}
pos := rand.Intn(len(data)) pos := rand.Intn(len(data))
data[pos] ^= 1 data[pos] ^= 1
} }

View File

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