mirror of
https://github.com/octoleo/restic.git
synced 2024-11-25 22:27:35 +00:00
Merge pull request #3947 from MichaelEischer/fix-cache-verify-test
cache: Fix file descriptor leak in TestBackendRemoveBroken
This commit is contained in:
commit
7ce4cb7908
3
internal/cache/backend_test.go
vendored
3
internal/cache/backend_test.go
vendored
@ -199,6 +199,9 @@ func TestBackendRemoveBroken(t *testing.T) {
|
|||||||
|
|
||||||
// check that the cache now contains the correct data
|
// check that the cache now contains the correct data
|
||||||
rd, err := c.load(h, 0, 0)
|
rd, err := c.load(h, 0, 0)
|
||||||
|
defer func() {
|
||||||
|
_ = rd.Close()
|
||||||
|
}()
|
||||||
test.OK(t, err)
|
test.OK(t, err)
|
||||||
cached, err := ioutil.ReadAll(rd)
|
cached, err := ioutil.ReadAll(rd)
|
||||||
test.OK(t, err)
|
test.OK(t, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user