mirror of
https://github.com/octoleo/restic.git
synced 2024-12-22 19:08:55 +00:00
Merge pull request #4316 from MichaelEischer/fix-check-modified-data
Fix flaky TestCheckerModifiedData test
This commit is contained in:
commit
fefe15d7a1
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user