forked from TrueCloudLab/restic
Merge pull request #4316 from MichaelEischer/fix-check-modified-data
Fix flaky TestCheckerModifiedData test
This commit is contained in:
commit
fefe15d7a1
2 changed files with 1 additions and 5 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue